[magick-users] Bitonal bitmap out

Illtud Daniel illtud.daniel at llgc.org.uk
Wed Jan 24 04:04:36 CST 2007


Anthony Thyssen wrote:

> You could try the PBM format, and delete the header.

Yes, that was going to be one of my approaches, but I couldn't
work out how to do it without writing out to an intermediate
file (I'm no programmer) - in the cold light of morning I suppose
imagetoblob(magick=>'pbm') would have done it. This is what I
ended up with:

@pixels = 
$ffoto->GetPixels(map=>'I',height=>$height,width=>$width,normalize=>true);
print (pack('B*',join('', at pixels)));

...but I'd like to put in a feature request for a bitonal
bitmap format without any header. It would be trivial to implement
given that 'mono' already exists. Or make 'mono' listen to the
endian parameter. It seems odd to have to cludge a way to get
bitonal pixel representation out of an image.

-- 
Illtud Daniel                                 illtud.daniel at llgc.org.uk
Uwch Ddadansoddwr Systemau                       Senior Systems Analyst
Llyfrgell Genedlaethol Cymru                  National Library of Wales
Yn siarad drosof fy hun, nid LlGC   -  Speaking personally, not for NLW


More information about the Magick-users mailing list