dds to png conversion colors wrong
-
- Posts: 5
- Joined: 2016-04-28T11:49:49-07:00
- Authentication code: 1151
dds to png conversion colors wrong
Hi All.
I'm new to ImageMagick, and am trying to convert an existing .dds image to .png, (or anything else for that matter).
Here's my command string:
convert colorbars.dds -set colorspace ycbca -colorspace rgb newfile.png
The original image can be found here: http://www.video-impressions.com/images/colorbars.dds
All of my conversion attempts either come out purple-ish, or green-ish, so I'm guessing it's a channel thing, but I'm just not that familiar with the program yet.
Any help would be appreciated.
Thanks,
Mike
I'm new to ImageMagick, and am trying to convert an existing .dds image to .png, (or anything else for that matter).
Here's my command string:
convert colorbars.dds -set colorspace ycbca -colorspace rgb newfile.png
The original image can be found here: http://www.video-impressions.com/images/colorbars.dds
All of my conversion attempts either come out purple-ish, or green-ish, so I'm guessing it's a channel thing, but I'm just not that familiar with the program yet.
Any help would be appreciated.
Thanks,
Mike
Re: dds to png conversion colors wrong
What is your operating system and your ImageMagick version? And what is wrong with the output? It does contain green-ish and purple-ish values. Can you post your output somewhere?
-
- Posts: 5
- Joined: 2016-04-28T11:49:49-07:00
- Authentication code: 1151
Re: dds to png conversion colors wrong
Windows 7 64bit
ImageMagick -6.9.3-Q16
Input file: http: http://www.video-impressions.com/images/colorbars.dds
Output file: http://www.video-impressions.com/images/newfile.png
What file should look like: http://www.video-impressions.com/images/ColorBars.png
The output is purple-ish when opened in photoshop.
Thanks for your assistance!
ImageMagick -6.9.3-Q16
Input file: http: http://www.video-impressions.com/images/colorbars.dds
Output file: http://www.video-impressions.com/images/newfile.png
What file should look like: http://www.video-impressions.com/images/ColorBars.png
The output is purple-ish when opened in photoshop.
Thanks for your assistance!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: dds to png conversion colors wrong
Is ycbca a type? Should it not be YCbCr? Also you should be using -colorspace srgb (for current versions of IM).convert colorbars.dds -set colorspace ycbca -colorspace rgb newfile.png
Code: Select all
convert colorbars.dds -set colorspace ycbcr -colorspace srgb newfile.png
-
- Posts: 5
- Joined: 2016-04-28T11:49:49-07:00
- Authentication code: 1151
Re: dds to png conversion colors wrong
Sorry...I had a typo.
Below is the command string:
convert colorbars.dds -set colorspace ycbcr -colorspace rgb newfile.png
I've also tried:
convert colorbars.dds -set colorspace ycbcra -colorspace rgb newfile.png
Below is the command string:
convert colorbars.dds -set colorspace ycbcr -colorspace rgb newfile.png
I've also tried:
convert colorbars.dds -set colorspace ycbcra -colorspace rgb newfile.png
-
- Posts: 5
- Joined: 2016-04-28T11:49:49-07:00
- Authentication code: 1151
Re: dds to png conversion colors wrong
I'm not sure what the original colorspace is, so I've tried just about every one, as well as omitting the value and going with the default as well.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: dds to png conversion colors wrong
After the image has been read, the colorspace is similar to YCbCr, but in the order CbYCr so we need to swap the first two channels.
The result is close to the required colour chart, but not exactly the same.
Code: Select all
convert colorbars.dds -separate -swap 0,1 -combine -set colorspace YCbCr -colorspace sRGB x2.png
snibgo's IM pages: im.snibgo.com
-
- Posts: 5
- Joined: 2016-04-28T11:49:49-07:00
- Authentication code: 1151
Re: dds to png conversion colors wrong
That's great...now it just seems like a gamma issue maybe...
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: dds to png conversion colors wrong
Sadly, no, it isn't just a gamma issue. My result gives "gray" patches that have slightly different values in the three channels.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: dds to png conversion colors wrong
snibgo, I am just curious. I do not know DDS image format, so I am curious how you knew the channels were swapped. Are the Cb and Cr channels much different from the Y channel in values? Or was it just a guess on the way the colors seemed swapped?snibgo wrote:After the image has been read, the colorspace is similar to YCbCr, but in the order CbYCr so we need to swap the first two channels.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: dds to png conversion colors wrong
I know nothing about DDS.
After a simple "convert in.dds out.tiff" conversion, I looked at the pixel values in the bars that should be varying lightnesses of gray, using an image editor with eyedropper. The first and last channels were around 50%, with the middle value varying. So the middle channel seemed to be luminance or Y. I tried all the Y?? colorspaces and YCbCr seemed the closest fit.
I don't know if IM's DDS reader does any colorspace conversion, or re-arrangement of channels. dds.c is quite complex.
After a simple "convert in.dds out.tiff" conversion, I looked at the pixel values in the bars that should be varying lightnesses of gray, using an image editor with eyedropper. The first and last channels were around 50%, with the middle value varying. So the middle channel seemed to be luminance or Y. I tried all the Y?? colorspaces and YCbCr seemed the closest fit.
I don't know if IM's DDS reader does any colorspace conversion, or re-arrangement of channels. dds.c is quite complex.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: dds to png conversion colors wrong
snibgo,
You said that you used
and that did not quite work out. Had you tried swapping Cb and Cr along with moving Y to the middle channel, i.e.
If so, was that better or worse?
You said that you used
Code: Select all
convert colorbars.dds -separate -swap 0,1 -combine -set colorspace YCbCr -colorspace sRGB x2.png
Code: Select all
convert colorbars.dds -separate -swap 1,2 -combine -set colorspace YCbCr -colorspace sRGB x2.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: dds to png conversion colors wrong
Of the possible arrangement of channels Y-Cb-Cr, the one that fits best is Cb-Y-Cr. All other arrangements are clearly worse.
@videomike99: What software created colorbars.dds, or where did you get it from?
@videomike99: What software created colorbars.dds, or where did you get it from?
snibgo's IM pages: im.snibgo.com