From this bug report:
This image looks ok:
But if you take the 263px version (size for inside a dutch infobox, the image
seems to be rendered completely wrong (darker):
Did something go wrong with image scaling?
What causes images to be rendered dark?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: What causes images to be rendered dark?
The image is cmyk. IM probably does not resize well unless you convert the image first to rgb (preferably with profiles)
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: What causes images to be rendered dark?
More than likely the image is CMYK as Fred said.
But that does not explain the horizontal lines in the image.
I have only seen such lines when VERY low level type composition is used to recreate CMYK images using composition.
See http://www.imagemagick.org/Usage/bugs/testing/
This low level technique failed as CopyBlack composition does not understand grayscale images, only CMYK images, resulting in part of memory being copied instead! Though using the correct higher level operator -combine to do this does work properly.
More information on exact you are operating on the images is needed.
But that does not explain the horizontal lines in the image.
I have only seen such lines when VERY low level type composition is used to recreate CMYK images using composition.
See http://www.imagemagick.org/Usage/bugs/testing/
This low level technique failed as CopyBlack composition does not understand grayscale images, only CMYK images, resulting in part of memory being copied instead! Though using the correct higher level operator -combine to do this does work properly.
More information on exact you are operating on the images is needed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: What causes images to be rendered dark?
In the original bug report Tim suggests adding "-colorspace rgb". Would that help? Would it hurt images that are not cmyk?fmw42 wrote:The image is cmyk. IM probably does not resize well unless you convert the image first to rgb (preferably with profiles)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: What causes images to be rendered dark?
If you are on a version of IM after 6.7.5.5 (possibly as late as 6.7.6.7) you need to use -colorspace sRGB, as after that sRGB and RGB were switched in -colorspace. However, the conversion to rgb would be best done using profiles, that is more accurate color conversion. Adding -colorspace sRGB/RGB should not matter if our image is already sRGB.hexmode wrote:In the original bug report Tim suggests adding "-colorspace rgb". Would that help? Would it hurt images that are not cmyk?fmw42 wrote:The image is cmyk. IM probably does not resize well unless you convert the image first to rgb (preferably with profiles)
convert cykmimage.jpg -colorspace sRGB -resize ... rgbimage.jpg
or use profiles,
see
http://www.imagemagick.org/Usage/formats/#profiles
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: What causes images to be rendered dark?
With regards to CMYK. CMYK is ment to be a linear colorspace. As a result of the sRGB RGB this change CMYK will be correctly converted to linear colorspace when previously is was probably coming out with inverted sRGB values.
You can similulate what IM did previously with CMYK using (post change IM)
If your CMYK was produced with an old version of IM you can fix it to be correctly linear by using...
You can similulate what IM did previously with CMYK using (post change IM)
Code: Select all
convert image -set colorspace RGB -colorspace CMYK .....
Code: Select all
convert old_cmyk_image -colorspace RGB -set colorspace sRGB -colorspace CMYK new_cmyk_image
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/