v7 read or write problem

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

v7 read or write problem

Post by snibgo »

Windows 8.1, IM v7 downloaded today, ImageMagick-7.0.0-0~beta20140110-Q16-x64-dll.exe.

There is a problem reading or writing a greyscale image.

Create a greyscale image using IM v6.8.8-0:

Code: Select all

%IM%convert -size 100x200 gradient: ^
  -rotate 90 ^
  hdri_grad.png
Image

Read it and write it with v7:

Code: Select all

%IMGF%magick ^
  hdri_grad.png ^
  hdri_gradSv.png
Image
The result is red where I would expect grey. It has populated just the red channel instead of all three.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: v7 read or write problem

Post by fmw42 »

Grayscale images in IM 7 have only one channel. That may be the issue. In IM 6 they have 3 channels. So there may be an import issue between IM 6 grayscale images to IM 7.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: v7 read or write problem

Post by snibgo »

The same problem occurs when v7 creates the first file.

Yes, I guess the problem arises from v7 storing greyscale as a single channel.

A simpler demo of (probably) the same problem:

Code: Select all

F:\web\im>%IMGF%magick -size 2x1 gradient: g.png

F:\web\im>%IMGF%magick g.png txt:
# ImageMagick pixel enumeration: 2,1,255,srgb
0,0: (255,255,255)  #FFFFFF  white
1,0: (0,0,0)  #000000  black

F:\web\im>%IMGF%magick -size 3x1 gradient: g.png

F:\web\im>%IMGF%magick g.png txt:
# ImageMagick pixel enumeration: 3,1,65535,srgb
0,0: (100%,0%,0%)  #FFFF00000000  red
1,0: (50.0008%,0%,0%)  #800000000000  srgb(50.0008%,0%,0%)
2,0: (0%,0%,0%)  #000000000000  black
The 2x1 gradient gives the corect greyscale result. The 3x1 gradient populates (or or writes to txt) just the red channel.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: v7 read or write problem

Post by fmw42 »

Now that is really odd (pardon the pun)
Post Reply