Live data from Hacker News

Using ImageMagick to make sharp web-sized photographs

even.li

21–30 of 64 posts

Re: Using ImageMagick to make sharp web-sized photographs

#23
post #12

Tangential to the point being made, 98 as quality seems way too high for an image to be shown on the web. 85 seems to be a decent tradeoff. Doing so might actually increase the image size.

I agree: that jumped out at me enough that I came here to make the same comment. I can hardly think of a case where I'd want to use a 98 quality setting on a JPEG. Maybe it would be a good choice if I wanted to preserve an almost-pristine copy of an original, but I'd compare the resulting file size to a lossless PNG first. Every quality step from 100 down to 95 gives a huge benefit in file size, and going from 95 to 90 almost always seems like a hefty savings for imperceptible differences, too. I usually save web images at quality settings between 70 and 90, and I've never felt like I'm losing by it.

Re: Using ImageMagick to make sharp web-sized photographs

#24

The sharpened version looks over-sharp to me. You may find that a level or curves adjustment is more what this image needs to pop a little.

Yup, I over-sharpened it a little so the effect is more obvious.

Though the amount of sharpening can depend on the context : photographers tend to be annoyed by over-sharp images, while on a marketing website it might be good idea to make the pictures pop.

Re: Using ImageMagick to make sharp web-sized photographs

#25
post #8

Earlier quoted context omitted.

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…

I tested this with a couple of images and you are right. Except for a few errant pixels here and there the images are precisely identical. Sorry for the misinformation.

Re: Using ImageMagick to make sharp web-sized photographs

#26
post #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.

I run into this same issue when creating previews from print comps. You should be able to specify a colorspace to resolve that: http://blog.rodneyrehm.de/archives/4-CMYK-Images-And-Browser...

Re: Using ImageMagick to make sharp web-sized photographs

#27
post #23
post #12

Tangential to the point being made, 98 as quality seems way too high for an image to be shown on the web. 85 seems to be a decent tradeoff. Doing so might actually increase the image size.

I agree: that jumped out at me enough that I came here to make the same comment. I can hardly think of a case where I'd want to use a 98 quality setting on a JPEG. Maybe it would be a good choice if I wanted to preserve an almost-pristine copy of an original, but I'd compare the resulting file size to a lossless PNG first. Every quality step from 100 down to 95 gives a huge benefit in file size, and going from 95 to…

True, my app processes around 100,000 images daily and it uses a quality of 85. Never had a problem. But I do keep an archive of the original image just in case

Re: Using ImageMagick to make sharp web-sized photographs

#28
post #26
post #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.

I run into this same issue when creating previews from print comps. You should be able to specify a colorspace to resolve that: http://blog.rodneyrehm.de/archives/4-CMYK-Images-And-Browser...

Yeah, but changing the color space to RGB also significantly alters the way it appears. Then I have users who complain that this is not what they uploaded and its a genuine complain.

I was going to suggest that the real problem is people using IE8 but that wouldn't go too well I guess

Re: Using ImageMagick to make sharp web-sized photographs

#29
post #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?

He has an example at his github link where he uses a simple bash for loop to do many images at once.
Post reply on HN