convert darkens an xcf image
convert darkens an xcf image
Hallo,
I have Fedora 19, ImageMagick-6.7.8.9-5.fc19.i686 I use convert on a xcf, but the result is
darker than the original image.
Could you please allow me to attach the xcf-file?
DanielDD
I have Fedora 19, ImageMagick-6.7.8.9-5.fc19.i686 I use convert on a xcf, but the result is
darker than the original image.
Could you please allow me to attach the xcf-file?
DanielDD
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert darkens an xcf image
Put it somewhere on the web, such as dropbox.com, and paste the URL here.
Please also paste your command here.
Please also paste your command here.
snibgo's IM pages: im.snibgo.com
Re: convert darkens an xcf image
Link: https://www.dropbox.com/s/v8a7b7vp3d7pcny/i1.xcf
I took a photo with a Canon 70D, and I cropped a part with gimp.
I tried convert i1.xcf i1.jpg
but the image becomes darker.
DanielDD
I took a photo with a Canon 70D, and I cropped a part with gimp.
I tried convert i1.xcf i1.jpg
but the image becomes darker.
DanielDD
Re: convert darkens an xcf image
It seems that ImageMagick sets the colorspace to sRGB instead of RGB. Not sure if this is a bug. Changing the colorspace to RGB fixes the problem.
-
- Posts: 111
- Joined: 2013-10-02T10:49:39-07:00
- Authentication code: 6789
- Location: New York, US
Re: convert darkens an xcf image
Should IM assume an xcf image is RGB by default? Is there something in the image format that indicates this or is it always in the same colorspace? (Of course if someone want to get the results even more accurate, they might have to use an icc profile of the image format or camera for the transformation to sRGB.)dlemstra wrote:It seems that ImageMagick sets the colorspace to sRGB instead of RGB. Not sure if this is a bug. Changing the colorspace to RGB fixes the problem.
-Dabrosny [Using IM7.0.6 or higher, Q16 HDRI x64 native executable, command line, often invoked from cygwin bash/sh (as of Aug. 2017)]
Re: convert darkens an xcf image
I tried:
and
The image became even darker.
Using sRGB instead of RGB produced the same result as before.
DanielDD
Code: Select all
convert i1.xcf -colorspace RGB i1.jpg
Code: Select all
convert -colorspace RGB i1.xcf i1.jpg
Using sRGB instead of RGB produced the same result as before.
DanielDD
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert darkens an xcf image
There seems to be a bug, though I don't know whether in IM or Gimp.
1. Create a sample file:
2. Read this in Gimp v2.8.2. Save as twoGrad.xcf, and export as twoGrad2.png.
3. Convert the XCF to PNG, and compare with the original.
D:\web\im>%IM%convert twoGrad.xcf tg.png
D:\web\im>%IM%compare -metric RMSE twoGrad.png tg.png NULL:
12589.7 (0.192106) <== bad
4. Convert the XCF to PNG, forcing a conversion from RGB->sRGB, and compare with the original.
D:\web\im>%IM%convert twoGrad.xcf -set colorspace RGB -colorspace sRGB tgrgb.png
D:\web\im>%IM%compare -metric RMSE twoGrad.png tgrgb.png NULL:
4009.47 (0.0611806) <== acceptable
5. Compare the PNG creeated by Gimp with the original.
D:\web\im>%IM%compare -metric RMSE twoGrad.png twoGrad2.png NULL:
94.0714 (0.00143544) <== good
EDIT to add: tests done with IM v6.8.7-0 and Gimp 2.8.2 on Windows 7.
1. Create a sample file:
Code: Select all
"%IM%convert" -size 300x200 xc: ^
-sparse-color Bilinear "0,0 white %%[fx:w-1],0 rgb(90%%,60%%,50%%) 0,%%[fx:h-1] rgb(20%%,30%%,40%%) %%[fx:w-1],%%[fx:h-1] black" ^
twoGrad.png
3. Convert the XCF to PNG, and compare with the original.
D:\web\im>%IM%convert twoGrad.xcf tg.png
D:\web\im>%IM%compare -metric RMSE twoGrad.png tg.png NULL:
12589.7 (0.192106) <== bad
4. Convert the XCF to PNG, forcing a conversion from RGB->sRGB, and compare with the original.
D:\web\im>%IM%convert twoGrad.xcf -set colorspace RGB -colorspace sRGB tgrgb.png
D:\web\im>%IM%compare -metric RMSE twoGrad.png tgrgb.png NULL:
4009.47 (0.0611806) <== acceptable
5. Compare the PNG creeated by Gimp with the original.
D:\web\im>%IM%compare -metric RMSE twoGrad.png twoGrad2.png NULL:
94.0714 (0.00143544) <== good
EDIT to add: tests done with IM v6.8.7-0 and Gimp 2.8.2 on Windows 7.
Last edited by snibgo on 2013-10-28T06:16:40-07:00, edited 1 time in total.
snibgo's IM pages: im.snibgo.com
Re: convert darkens an xcf image
My mistake I read that the image should be darker. Can you post 'twoGrad2.png' somewhere snibgo?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert darkens an xcf image
Click on the links, and download:
https://www.dropbox.com/s/bifv8ht7oh0hlrc/twoGrad2.png
https://www.dropbox.com/s/i1nyy5o4i7c2nix/twoGrad.xcf
https://www.dropbox.com/s/bifv8ht7oh0hlrc/twoGrad2.png
https://www.dropbox.com/s/i1nyy5o4i7c2nix/twoGrad.xcf
snibgo's IM pages: im.snibgo.com
Re: convert darkens an xcf image
I get an error when I run your command:
convert.exe: invalid argument for option `sparse-color': Invalid number of Arguments @ error/mogrify.c/SparseColorOption/522.
convert.exe: invalid argument for option `sparse-color': Invalid number of Arguments @ error/mogrify.c/SparseColorOption/522.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert darkens an xcf image
Copying the command into a bat file, and executing that, works for me (on Windows 7).
It also works by pasting it directly into a command window, but then we need to replace each "%%[fx" with "%[fx".
If on Unix, it needs more changes, of course.
It also works by pasting it directly into a command window, but then we need to replace each "%%[fx" with "%[fx".
If on Unix, it needs more changes, of course.
snibgo's IM pages: im.snibgo.com
Re: convert darkens an xcf image
I just copy pasted into the command line and that didn't work. It works when I run it from a batch file, I will investigate it further.
Re: convert darkens an xcf image
This works on Ubuntu:
Code: Select all
convert -debug coder -log %e -verbose -size 300x200 xc: \
-sparse-color Bilinear '0,0 white %[fx:w-1],0 rgb\(90%,60%,50%\) 0,%[fx:h-1] rgb\(20%,30%,40%\) %[fx:w-1],%[fx:h-1] black' \
twoGrad.png
Re: convert darkens an xcf image
I found a workaround:
xcf2pnm is a part of the xcftools package.
DanielDD
Code: Select all
xcf2pnm i1.xcf | convert - i1.jpg
DanielDD
Re: convert darkens an xcf image
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.7-5 Beta available by sometime tomorrow. Thanks.