Mailing List Archive

Your opinion on jpeg encoders, please
Hi all,

this is not really a Gentoo-specific question, but some of you know your way
around stuff, so here goes.

When I edit photos, I like to shrink and recompress them to save on space,
but not mangle them too much in the process to lose quality. So for average
images I tend to use a quality setting between 80 and 86, very bad shots
such as defocussed or blurred ones just 70. And for the really good ones
(crystal sharp, portraits, extraordinary motives etc) 90 and more.

In the far past I’ve been using Gimp, but for some years now mostly Showfoto
(the editor from Digikam) due to its more useful photo enhancement features.

However I noticed that the latter procuces larger files for the same quality
setting. So currently, I first save with a very high setting from Showfoto
and then recompress the whole directory in a one-line-loop using
imagemagick’s convert. I have the impression that it produces far smaller
files at the same visual quality.


Now I know that one can’t fully compare quality settings of different
encoders, but it started me wondering: which is really “better”? Or maybe
just a little more enhanced, or up-to-date from an algorithmic standpoint?

Just because many distros and tools use libjpeg, that doesn’t mean it’s the
best one out there. Gimp, showfoto and convert use different encoders,
because compressing the same PNG with the same JPEG setting does not result
in three identical files.

Does any of you have an opinion on that matter?
Cheers.

--
Gruß | Greetings | Qapla’
Please do not share anything from, with or about me on any social network.

What do you call a man with a seagull on his head? – Cliff.
Re: Your opinion on jpeg encoders, please [ In reply to ]
On Mon, Jan 04, 2021 at 10:37:34PM +0100, Frank Steinmetzger wrote
>
> When I edit photos, I like to shrink and recompress them to save on
> space, but not mangle them too much in the process to lose quality.

Actually, shrinking *BY AN INTEGER NUMBER SHOULD IMPROVE QUALITY* as
well as saving space. In Google look up the phrase...

photography binning adjacent pixel

If you bin a 3840x2160 image by 2, you'll get a 1920x1080 result. If
you bin it by 3, you'll get 1280x720 image. The math is a bit
convoluted, but when you bin by a value of "n"...

* the information per combined pixel increases by a factor of "n"

* the noise per combined pixel increases by a factor of square root of "n"

So the "signal-to-noise-ratio" increases. The resulting image is less
noisey. The tradeoff is that the new image is smaller than the original.
I use the imagemagick "convert" utility from the commandline, but any
capable image software should work.

--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
Re: Your opinion on jpeg encoders, please [ In reply to ]
On 04/01/2021 23:37, Frank Steinmetzger wrote:
> However I noticed that the latter procuces larger files for the same quality
> setting. So currently, I first save with a very high setting from Showfoto
> and then recompress the whole directory in a one-line-loop using
> imagemagick’s convert.
You lose some extra quality when doing this due to recompression. What
you should do is save in a lossless format (like png or bmp) and then
convert that to jpg.
Re: Re: Your opinion on jpeg encoders, please [ In reply to ]
On 07/01/2021 02:22, Nikos Chantziaras wrote:
> On 04/01/2021 23:37, Frank Steinmetzger wrote:
>> However I noticed that the latter procuces larger files for the same
>> quality
>> setting. So currently, I first save with a very high setting from
>> Showfoto
>> and then recompress the whole directory in a one-line-loop using
>> imagemagick’s convert.

> You lose some extra quality when doing this due to recompression. What
> you should do is save in a lossless format (like png or bmp) and then
> convert that to jpg.
>
If you're doing that (which I recommend), I set my camera to "raw +
jpeg", and then dump the raw files to DVD. That way, it doesn't matter
what happens to the jpegs as you can always re-create them.

If you've only got jpegs (why are you using a rubbish camera :-) then
just dump the original jpegs to DVD - that's why what Google do is so
bad - they compress it to upload it from your Android phone, and then
delete the original! AND THAT'S THE DEFAULT !!!

Cheers,
Wol
Re: Re: Your opinion on jpeg encoders, please [ In reply to ]
Am Thu, Jan 07, 2021 at 05:12:07PM +0000 schrieb antlists:
> On 07/01/2021 02:22, Nikos Chantziaras wrote:
> > On 04/01/2021 23:37, Frank Steinmetzger wrote:
> > > However I noticed that the latter procuces larger files for the same
> > > quality
> > > setting. So currently, I first save with a very high setting from
> > > Showfoto
> > > and then recompress the whole directory in a one-line-loop using
> > > imagemagick’s convert.
>
> > You lose some extra quality when doing this due to recompression. What
> > you should do is save in a lossless format (like png or bmp) and then
> > convert that to jpg.

But that would lose a lot of EXIF stuff in the process. I know that
recompression reduces quality, that’s why I use a very high setting
(98…100) for the intermediate file.

> If you're doing that (which I recommend), I set my camera to "raw + jpeg",
> and then dump the raw files to DVD. That way, it doesn't matter what happens
> to the jpegs as you can always re-create them.

I don’t really live the RAW way. They take up sooo much space and my
camera’s OOC jpegs always look far nicer than anything I can produce with
darktable/rawtherapee. Most of the time there are colour fringes and
sometimes sensor patterns that I can’t get rid of. I already have a backlock
of several 100, if not 1000 pictures. Working from RAW would take even more
time. In some specific scenes I actually use RAW+Jpeg, mostly in scenes with
a very high dyamic range. But as I said, the results are not very
satisfactory.

> If you've only got jpegs (why are you using a rubbish camera :-)

I have an Olympus O-MD E-M5 MkII and a MkIII, that’s far from rubbish. ;-)
But the OOC jpegs are so good that I don’t need a lot of post-processing.
I tend to read manuals and set up my equipment to get the best result right
away, rather than point+shoot and do the enhancements later.

> then just dump the original jpegs to DVD - that's why what Google do is so
> bad - they compress it to upload it from your Android phone, and then
> delete the original! AND THAT'S THE DEFAULT !!!

I do some light enhancements on my images (like local contrast, exposure
correction, alignment), shrink them to – say, 6 MP – and only keep the
result. With convert, this gives me about 500 kB to 2 MB files, depending on
the scene and chosen quality from 70 to 90. For 95 % of cases, that’s
enough. There are exceptions of course, such as portraits, or the odd
animal picture captured in just the right moment.

--
Gruß | Greetings | Qapla’
Please do not share anything from, with or about me on any social network.

Rather idle around than do nothing at all.
Re: Re: Your opinion on jpeg encoders, please [ In reply to ]
On 11/01/2021 19:26, Frank Steinmetzger wrote:
> I don’t really live the RAW way. They take up sooo much space and my
> camera’s OOC jpegs always look far nicer than anything I can produce with
> darktable/rawtherapee.

Okay, dunno about your Olympus stuff, but my Nikon cameras, the Nikon
software is supposed to "load raw, save as jpeg", and it should come out
identical to the jpeg that came off the camera.

I do know, though, that some software (quite possibly that Nikon stuff)
won't run under wine, blowing up with "unknown version of Windows" or
something like that. So you might have the same problem ...

Cheers,
Wol
Re: Re: Your opinion on jpeg encoders, please [ In reply to ]
On Mon, 11 Jan 2021 20:26:26 +0100, Frank Steinmetzger wrote:

> > > You lose some extra quality when doing this due to recompression.
> > > What you should do is save in a lossless format (like png or bmp)
> > > and then convert that to jpg.
>
> But that would lose a lot of EXIF stuff in the process. I know that
> recompression reduces quality, that’s why I use a very high setting
> (98…100) for the intermediate file.

PNG supports EXIF tags, or you could use lossless JPEG.


--
Neil Bothwick

Top Oxymorons Number 39: Almost exactly
Re: Your opinion on jpeg encoders, please [ In reply to ]
On Mon, Jan 4, 2021 at 2:38 PM Frank Steinmetzger <Warp_7@gmx.de> wrote:
>
> Hi all,
>
> this is not really a Gentoo-specific question, but some of you know your
way
> around stuff, so here goes.
>
> When I edit photos, I like to shrink and recompress them to save on space,
> but not mangle them too much in the process to lose quality. So for
average
> images I tend to use a quality setting between 80 and 86, very bad shots
> such as defocussed or blurred ones just 70. And for the really good ones
> (crystal sharp, portraits, extraordinary motives etc) 90 and more.
>
> In the far past I’ve been using Gimp, but for some years now mostly
Showfoto
> (the editor from Digikam) due to its more useful photo enhancement
features.
>
> However I noticed that the latter procuces larger files for the same
quality
> setting. So currently, I first save with a very high setting from Showfoto
> and then recompress the whole directory in a one-line-loop using
> imagemagick’s convert. I have the impression that it produces far smaller
> files at the same visual quality.
>
>
> Now I know that one can’t fully compare quality settings of different
> encoders, but it started me wondering: which is really “better”? Or maybe
> just a little more enhanced, or up-to-date from an algorithmic standpoint?
>
> Just because many distros and tools use libjpeg, that doesn’t mean it’s
the
> best one out there. Gimp, showfoto and convert use different encoders,
> because compressing the same PNG with the same JPEG setting does not
result
> in three identical files.
>
> Does any of you have an opinion on that matter?
> Cheers.
>
> --
> Gruß | Greetings | Qapla’
> Please do not share anything from, with or about me on any social network.
>
> What do you call a man with a seagull on his head? – Cliff.

This topic comes up a lot with astrophotography. I took about 150 24M pixel
shots last night. It uses a lot of disk space.

From my reading - which isn't a lot - it seems to be technically superior
to simply downsample the original and then compress with jpeg if you need
to go that far vs using higher jpeg compression ratios on the original.

I have no data to back this up and it probably depends a lot on your source
material so YMMV but it's an option.

HTH,
Mark