From: Kurt on
I've written a small script to output a cmyk bitmap file but when I read the file back in it does not match the array written out. Using Matlab r2009a. Gimp does not open the file. Photoshop V7 does, and its the same as the corrupted imread.

% Define a cmyk bitmap pattern on a 32 x 32 grid.
pattern = logical( zeros([32,32,4]));

pattern(1,1,1) = true;
pattern(4,4,2) = true;
pattern(8,8,3) = true;
pattern(12,12,4) = true;

% 'Compression', 'lzw'
imwrite(pattern, 'pattern.tif', 'tiff', 'Compression', 'none', 'Resolution', [1200 1200]);


imfinfo on the written file looks okay.
>> imfinfo('pattern.tif')

ans =

Filename: 'pattern.tif'
FileModDate: '28-Jun-2010 16:32:25'
FileSize: 4302
Format: 'tif'
FormatVersion: []
Width: 32
Height: 32
BitDepth: 4
ColorType: 'CMYK'
FormatSignature: [73 73 42 0]
ByteOrder: 'little-endian'
NewSubFileType: 0
BitsPerSample: [1 1 1 1]
Compression: 'Uncompressed'
PhotometricInterpretation: 'CMYK'
StripOffsets: 8
SamplesPerPixel: 4
RowsPerStrip: 64
StripByteCounts: 4096
XResolution: 1200
YResolution: 1200
ResolutionUnit: 'Inch'
Colormap: []
PlanarConfiguration: 'Chunky'
TileWidth: []
TileLength: []
TileOffsets: []
TileByteCounts: []
Orientation: 1
FillOrder: 1
GrayResponseUnit: 0.0100
MaxSampleValue: [1 1 1 1]
MinSampleValue: 0
Thresholding: 1
Offset: 4104

>>
From: Doug Schwarz on
In article <i0b1tv$63o$1(a)fred.mathworks.com>,
"Kurt " <kurt.m.sanger(a)kodak.com> wrote:

> I've written a small script to output a cmyk bitmap file but when I read the
> file back in it does not match the array written out. Using Matlab r2009a.
> Gimp does not open the file. Photoshop V7 does, and its the same as the
> corrupted imread.
>
> % Define a cmyk bitmap pattern on a 32 x 32 grid.
> pattern = logical( zeros([32,32,4]));
>
> pattern(1,1,1) = true;
> pattern(4,4,2) = true;
> pattern(8,8,3) = true;
> pattern(12,12,4) = true;
>
> % 'Compression', 'lzw'
> imwrite(pattern, 'pattern.tif', 'tiff', 'Compression', 'none', 'Resolution',
> [1200 1200]);
>
>
> imfinfo on the written file looks okay.

[snip]

Hi Kurt,

Despite the fact that the docs say it's okay, imwrite (or perhaps
imread) seems not to work correctly for a logical array. I tried uint8
and it did work and the file size was the same so perhaps that would
work for you.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
From: Kurt on
Doug Schwarz <see(a)sig.for.address.edu> wrote in message <see-DC2F10.22074328062010(a)news.frontiernet.net>...
> In article <i0b1tv$63o$1(a)fred.mathworks.com>,
> "Kurt " <kurt.m.sanger&kodak.com> wrote:
>
> > I've written a small script to output a cmyk bitmap file but when I read the
> > file back in it does not match the array written out. Using Matlab r2009a.
> > Gimp does not open the file. Photoshop V7 does, and its the same as the
> > corrupted imread.
> >
> [snip]
>
> Hi Kurt,
>
> Despite the fact that the docs say it's okay, imwrite (or perhaps
> imread) seems not to work correctly for a logical array. I tried uint8
> and it did work and the file size was the same so perhaps that would
> work for you.
>
> --
> Doug Schwarz
> dmschwarz&ieee,org
> Make obvious changes to get real email address.

Doug;

Thanks but I'm trying to create cmyk bitmaps to use as a printer test target. The final pattern will be 720 MBit file size. In addition if we use Uint8's then the printer will screen the target which usually compromises the results of the test.

The results reading the written file in Photoshop suggest the issue is in imwrite and not imread.