imagemagick - python: wand autocompress monochromatic image on export. Any workaround? -
i'm working on tool cuts large image smaller tiles using imagemagick via python. , need tiles on same format (png, 8 or 16 bits).
in case, works fine, on monochromatic tiles imagemagick compresses picture on writing file. instance, pure black tiles compressed 1 bit picture.
i use plain save method, explained in the docs.
i found no documentation autocompressing feature nor way avoid this.
is there workaround or way can avoid happening?
edit:
for instance, if use code import 24bit rgb picture:
from wand.image import image img = image(filename ='http://upload.wikimedia.org/wikipedia/commons/6/68/solid_black.png') print img.type i type
bilevel if add this,
img.type = 'grayscale' print img.type once again get
bilevel if try force pixel depth this,
img.depth = 16 print img.type print img.depth i get:
bilevel 16 i thought maybe changed depth, once save image, become 1 bit depth again.
so seems me imagemagick automatically compresses picture , have no control on it. refuses change image type.
any ideas avoid this? way force pixel depth?
Comments
Post a Comment