Page 1 of 1

Downsizing large JPEGS and maintaining quality

Posted: 2018-12-27T20:51:30-07:00
by AakLak
Trying to resize some large (~5593 × 3309) JPEGS into smaller thumbnails. Im on MacOS
Quality is important, as this is for a photography website.

I'm currently using: convert "$f" -resize 500x500 -quality 100 -density 300 -set filename:f "%[t]-thumb" "%[filename:f].jpg"
However I'm seeing inconsistent results, and some are of very poor quality (Lines are getting blurry/blocky, see ex2 below.)

Appreciate any suggestions, thank you!

Edit - More Info:
Most images are of architecture/interiors.

Example 1:
Original Image - https://www.rishulbangar.com/img/archit ... 83-min.jpg
Converted Image - https://www.rishulbangar.com/img/archit ... -thumb.jpg
Issue - Can see lots of distortion on the converted image. Would like for it to look crisp.
Can especially be seen on mobile phones.

Example 2:
Original - https://i.imgur.com/3B0Lfv4.jpg
Downsized - https://i.imgur.com/Z9FKrHx.jpg
Issue - Wood planks by the pool are no longer straight lines.


Thank you

Re: Downsizing large JPEGS and maintaining quality

Posted: 2018-12-27T22:41:15-07:00
by fmw42
How are you judging the quality? From a digital display or from print. Changing the density will not change the quality of the output when viewing on a display. It will not improve the quality either by increasing the density. That will only enlarge the image on the print page.

What kind of images are you using? Are they natural scenes, graphics or line drawings? They type of image is important regarding which type of resizing filter you should use.

See

https://imagemagick.org/Usage/filter/
https://imagemagick.org/Usage/filter/nicolas/

In what way are they poor? Is it resolution/blurring or color changes. If the latter, you should include profiles in your processing.

_________________

Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Re: Downsizing large JPEGS and maintaining quality

Posted: 2018-12-28T04:06:38-07:00
by snibgo
Do they look blurry? Downsized photos often look better with some sharpening. I like the method shown at Resampling with halo minimization.

Re: Downsizing large JPEGS and maintaining quality

Posted: 2018-12-30T03:10:08-07:00
by AakLak
Updated OP with more info and example images.

Thanks @fmw42 and @snibgo. I'll try your suggestions.
Any further suggestions based on my sample images (in OP) would be appreciated.

Thank you.

Re: Downsizing large JPEGS and maintaining quality

Posted: 2018-12-30T03:26:41-07:00
by mikmach
If you want to keep quality to 100 option `-sampling-factor 1x1` doesn't matter much but is always good thing to include it when dealing with JPGs.

Simple `-unsharp` will do miracles when downsizing. Parameters you have to choose according to your taste. For me `1x1` is good enough although some may find it as oversharpening.

Re: Downsizing large JPEGS and maintaining quality

Posted: 2018-12-30T13:10:38-07:00
by fmw42
AakLak wrote: 2018-12-30T03:10:08-07:00 Updated OP with more info and example images.

Thanks @fmw42 and @snibgo. I'll try your suggestions.
Any further suggestions based on my sample images (in OP) would be appreciated.

Thank you.
I am not a photographer. So to me your downsized image looks fine. But other photographers may offer better suggestions than follows here.

I think it depends upon what you think is the issue. If you want more sharpness, you could try -filter catrom (though that is usually more relevant for upsizing). Or use -unsharp. If the issue is artifacts, then use some of the suggestions for downsizing from Nicolas Robidoux at https://imagemagick.org/Usage/filter/nicolas/. But note that JPG is a lossy compression even at -quality 100. Can you not use some other non-lossy compressed file such as PNG or TIFF or JP2000?

Re: Downsizing large JPEGS and maintaining quality

Posted: 2018-12-30T18:28:53-07:00
by snibgo
Another downsize-sharpen method I like is Limit min-max. This can sharpen without halos, and also without aliasing (aka jaggies, staircasing).

Of course, you wouldn't start from JPG inputs.