Page 1 of 1
Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T04:53:31-07:00
by rain
Hi
I am trying to resize my photos to display on my web site. I get Adobe RGB from my camera. But some web browsers does not support it. Therefore I want to convert them to sRGB. Now my question is that how do I do that and keep colors at the same time?
My current code is:
Code: Select all
convert in.jpg -resize 1365x2048 -quality 90 -set colorspace sRGB out.jpg
But that ruins my colors. Green goes to yellowish.
Here's sample:
Left is the way it should be (greener) right is what I get with -set colorspace sRGB.
And one more question that I have. I currently use -resize 1365x2048. Can I tell it instead that longest side should be 2048 so that it would automatically figure out that the other side should be 1365?
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T06:34:40-07:00
by glennrp
Regarding your second question, you can use "-resize 2048" or "-resize 2048x2048"
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T06:38:17-07:00
by glennrp
Regarding the first question, would you post a link to in.jpg? Also please tell us your ImageMagick version.
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T09:30:31-07:00
by snibgo
The photos from the camera probably have an embedded AdobeRGB profile. Use "-profile sRGB.icc" to convert the image to sRGB. You can also use an "-intent" setting if you want.
Ideally, don't start from a jpeg.
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T10:53:00-07:00
by rain
snibgo wrote:The photos from the camera probably have an embedded AdobeRGB profile. Use "-profile sRGB.icc" to convert the image to sRGB. You can also use an "-intent" setting if you want.
Ideally, don't start from a jpeg.
How do I exactly do that?
Code: Select all
convert in.jpg -resize 300x225 -quality 90 -profile sRGB.icc out.jpg
But
still shows
Code: Select all
icc:description: Adobe RGB (1998)
icc:manufacturer: Adobe RGB (1998)
icc:model: Adobe RGB (1998)
What -intent exactly does?
would you post a link to in.jpg?
I wont have access to this image till next weekend, but here is another one that behaves the same way:
http://regex.info/i/cs/Momiji-AdobeRGB-yes.jpg
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T11:36:42-07:00
by snibgo
Code: Select all
convert -verbose Momiji-AdobeRGB-yes.jpg -profile sRGB.icc x.jpg
"identify" shows x.jpg has the sRG profile, instead of AdobeRGB. sRGB.icc is in my current directory. If it wasn't, I would provide the full path to it.
For "-intent", see
http://www.imagemagick.org/script/comma ... php#intent
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T12:17:38-07:00
by rain
But did you try "identify -verbose" ? it still shows it is Adobe RGB. Also when you open it with gimp it tells you that it Adobe RGB and asks you if you want to convert this.
An other notice I made is that when you remove "-verbose" from "identify" then it also thinks that the original file is sRGB (Momiji-AdobeRGB-yes.jpg)
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T12:44:14-07:00
by fmw42
Works fine for me on IM 6.9.2.5 Q16 Mac OSX
Code: Select all
identify -verbose Momiji-AdobeRGB-yes.jpg
Properties:
date:create: 2015-11-01T11:38:29-08:00
date:modify: 2006-09-17T02:10:46-07:00
icc:copyright: Copyright 1999 Adobe Systems Incorporated
icc:description: Adobe RGB (1998)
icc:manufacturer: Adobe RGB (1998)
icc:model: Adobe RGB (1998)
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: 60fe692041631c128b7a51ebb3d63fcc79f3717b4cbf4b574b97f36b5d34c707
Code: Select all
convert Momiji-AdobeRGB-yes.jpg -profile /Users/fred/images/profiles/sRGB.icc x.jpg
identify -verbose x.jpg
Properties:
date:create: 2015-11-01T11:41:40-08:00
date:modify: 2015-11-01T11:41:40-08:00
icc:copyright: sRGB built-in
icc:description: sRGB built-in
icc:manufacturer: (lcms internal)
icc:model: sRGB built-in
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: 5512ae183d209066618cd14092102ae971f2732906341ee1326039d8400ed2b0
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T13:11:58-07:00
by snibgo
What version IM are you using? What platform? On v6.9.1-6, Windows 8.1, it converts fine.
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T15:10:14-07:00
by rain
LinuxVersion: ImageMagick 6.6.0-4 2015-05-28 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
Debian 6.0.7 "squeeze"
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-01T15:30:18-07:00
by fmw42
Your version is about 320 versions old. You might consider upgrading.
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-02T04:06:13-07:00
by rain
I cant upgrade it. It's on my web hosting company.
Re: Need help with resizing AdobeRGB images for web
Posted: 2015-11-02T05:37:49-07:00
by Bonzo
They should upgrade it for you and if not I would change companies. There are plenty of choices around these days.
Alternatively you can install Imagemagick on your computer. I have it installed and have written a batch file where I drop the image over the icon and it carries out my conversions for me.