Live data from Hacker News

Using ImageMagick to make sharp web-sized photographs

even.li

11–20 of 64 posts

Re: Using ImageMagick to make sharp web-sized photographs

#11

My solution: https://github.com/vladstudio/Vladstudio-smart-resize-Bash-s... The biggest problem of scaling down an image is to find right settings for resampling and sharpening. After many expreiments, I found it impossible to achieve good results by simply running convert with a line of arguments. So I came up with this script, which basically does the following: * configures -interpolate bicubic -filter Lagrange;…

This looks interesting, do you have any sample images for comparison?

Re: Using ImageMagick to make sharp web-sized photographs

#13
post #8

Just for the record, the "unsharp mask" filter doesn't really sharpen but it increases edge contrast, which makes it seem sharper. It is something that you should only apply to the final version of an image, after all resizing has been done, however.

Sharpening improves "acutance"; your perception of boundaries. https://en.wikipedia.org/wiki/Acutance Unsharp masking is mostly aesthetic. For an image like the example, a mountainside, it gives you a feeling of crisp details, but there isn't any more data there. It looks great on a landscape, but it can be disastrous on a portrait of a person (pores and stubble will be highlighted, usually in an unpleasant way). (ED…

> I have found that unsharp mask is best applied before you scale the image. Shrinking the image first will eliminate some of the details that you wanted to enhance in the first place.

Unsharp mask doesn't work that way: you get the same results applying it before or after scaling, as long as you adjust the radius accordingly.

The reason I suggested applying it after scaling is because aesthetically pleasing settings don't change much as the image size changes.

Re: Using ImageMagick to make sharp web-sized photographs

#14

I think the script to apply it to a folder could be clear with: for image in *.jpg ; do gm convert $image -resize "900x" -unsharp 2x0.5+0.5+0 -quality 98 `basename $image .jpg`_s.jpg ; done

imagemagick/graphicsmagick comes with a batch tool called mogrify. no need for scripting.

Re: Using ImageMagick to make sharp web-sized photographs

#17

My solution: https://github.com/vladstudio/Vladstudio-smart-resize-Bash-s... The biggest problem of scaling down an image is to find right settings for resampling and sharpening. After many expreiments, I found it impossible to achieve good results by simply running convert with a line of arguments. So I came up with this script, which basically does the following: * configures -interpolate bicubic -filter Lagrange;…

This is fine if you have a limited set of images that you handpick and optimize.

Do you have any suggestions when there are thousands of images and all this needs to be automated?

Re: Using ImageMagick to make sharp web-sized photographs

#19
One problem I recently encountered is that some images refused to load on IE8. Turns out that the IE does not support CYMK color spaced images and the image appeared significantly differently on chrome and firefox. Was quite surprising since I had assumed that jpeg was a standard format and would be supported by all.
Post reply on HN