"Amadeus W. M." on wrote... | I'm trying to crop a a pgm image like this: | | convert -crop 50x50 lena.pgm tmp.pgm | | The resulting pgm has white value = 65535 rather than 255: | | head -3 tmp.pgm | P5 | 50 50 | 65535 | | even though the original is ok: | | head -3 lena.pgm | P5 | 208 222 | 255 | | Also, the resulting tmp.pgm image has size 92722 bytes rather than | 50x50=2500 as I'd expect (without the header). Despite all this, xv | displays it correctly. I don't understand. What's going on? | | Thanks! | You are using a Q16 version of IM which premotes all color values to 16 bit quality (-depth 16).
The thrid line just says what the maximum value is for the data that follows. If you want it 255 you can set -depth 8 before saving the PGM file. At this time there is no use of -quality to set an odd quality value for PGM, PPM, PNM, and PAM images. Eg: a Maximum value of 15 should be posible using -quality 16 but this has not been implemented. It is on the 'Future Proposals' page however. http://www.cit.gu.edu.au/~anthony/graphics/imagick6/bugs/future/#quality You can select between the plain text PGM (P2) and binary PGM (P5) by using the -compress setting. For example --- a plain text PGM (P2)... compress pattern:fishscales -compress None PGM:- Or a binary PGM image (P5) compress pattern:fishscales PGM:- or compress pattern:fishscales +compress PGM:- Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- "We've heard that a million monkeys at a million keyboards could produce the "Complete Works of Shakespeare"; now thanks to the Internet, we know that this in NOT true." -- Robert Wilensky, University of Califonia ----------------------------------------------------------------------------- Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/ _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
