Page 1 of 1
Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-28T09:56:12-07:00
by kaldari
Wikipedia (and all Wikimedia projects) currently use convert -thumbnail for resizing uploaded images for display in articles and image pages. The -thumbnail flag, however, not only resizes the image, but also strips the metadata and the color profile (similar to the -strip flag). Since "thumbnails" are the main way in which Wikipedia images are viewed, ideally we would like to retain the color profile information (so that Van Gogh's sunflowers don't look like daisies). The only solution that we know of would be to switch to using -resize instead of -thumbnail, however, this leaves all the metadata which can double the size of the file.
What we would like, ideally, is for convert to have a new flag that is identical to -strip, but leaves the color profile, i.e. only strips the metadata. Perhaps something like "-metastrip". Then we could use convert -metastrip -resize to generate all our images.
The MediaWiki bug discussing this issue can be found at
https://bugzilla.wikimedia.org/show_bug.cgi?id=19960.
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-28T10:20:15-07:00
by magick
We will add a patch to the next ImageMagick point release such that -thumbnail removes all profiles except the color profile. Look for it in about a week or two. Thanks.
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-28T10:36:10-07:00
by kaldari
Wow, that's even better! Thanks!
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-28T11:35:06-07:00
by fmw42
Sorry to poke my head into this. But I might suggest that this be thought out a bit more. I suspect many users like the fact that -thumbnail strips everything so as to get a minimum size result. Perhaps it might be better to use a -set option to permit maintaining the color profile. That way it maintains backward compatibility. Just a suggestion.
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-28T11:47:22-07:00
by Bonzo
I agree with Fred, I like -thumbnail to strip everything it can to reduce image size and I think that should be the default setting.
There must be a lot of users using -thumbnail for this purpose and it will be quite an effort to change code that has been written some time. I have been involved in 4 website that would need to be changed. Other users could have even more.
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-29T09:54:45-07:00
by kaldari
Why would you ever want the color profile stripped out? It only takes up about 3K and makes sure that your thumbnails are displayed in the same colors as the original file. Isn't that worth 3K? Leaving the color profile in by default makes sense to me. I think most people would value having their images display accurately over saving 3K of memory, but it probably depends on if you're talking to programmers or photographers
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-29T11:35:44-07:00
by magick
Leaving the color profile in by default makes sense to me.
We agree. The fix will be available later this week with the ImageMagick 6.5.4-7 point release. To get the prior behavior just use this command:
- convert image.jpg -thumbnail 120x120 -strip thumbnail.jpg
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-07-30T21:10:04-07:00
by fmw42
Point taken and at least there is a fall back to past behavior.
Re: Wikipedia needs a -metastrip flag for convert
Posted: 2009-08-04T20:05:15-07:00
by anthony
I have noted this as a version "WARNING" note in both "thumbnail" and "resize" sections of IM Examples where "-thumbnail" is introduced.
Question; would such a color profile be saved to GIF or PNG images?