Hello,
I was wondering if ImageMagick uses more memory than needed for pixels.
If I load an image that has 256^2 colors, ImageMagick will use 2 bytes per pixel, right?
But, if I load an image that only has 2 colors, will ImageMagick use 1 bit per pixel for memory or 1 byte per pixel?
I am concerned about efficiency.
Thanks in advance!
Monochrome Memory Reduction?
-
- Posts: 36
- Joined: 2010-02-21T18:02:40-07:00
- Authentication code: 8675308
-
- Posts: 36
- Joined: 2010-02-21T18:02:40-07:00
- Authentication code: 8675308
Re: Monochrome Memory Reduction?
Thanks, I read through that page and what I picked up is that Imagemagick does not use less memory for monochrome images. It must hold a minimum of 4 unsigned bytes per pixel.
Is this true?
Thanks,
Sorry for the late response.
Is this true?
Thanks,
Sorry for the late response.
-
- Posts: 36
- Joined: 2010-02-21T18:02:40-07:00
- Authentication code: 8675308
Re: Monochrome Memory Reduction?

-
- Posts: 36
- Joined: 2010-02-21T18:02:40-07:00
- Authentication code: 8675308
Re: Monochrome Memory Reduction?
Are you sure? I can't believe that ImageMagick would have such a design.
What if I am working with .gif images of 9 million pixels with only 2^8 = 256 colors? Normally I would only need 1 byte per pixel in this case, but ImageMagick requires 4 bytes (= 4 times as much memory)?
What if I am working with .gif images of 9 million pixels with only 2^8 = 256 colors? Normally I would only need 1 byte per pixel in this case, but ImageMagick requires 4 bytes (= 4 times as much memory)?
Re: Monochrome Memory Reduction?
Read http://www.imagemagick.org/script/archi ... p#overview. It explains why we took the design approach we did with the pixel cache. If memory is an issue, use -limit area 0 to force the pixels to disk. If that solution is not acceptable there are plenty of alternative image processing utilities that have a smaller memory footprint than ImageMagick.
-
- Posts: 36
- Joined: 2010-02-21T18:02:40-07:00
- Authentication code: 8675308
Re: Monochrome Memory Reduction?
Okay. It was done for efficiency and generability.
Thanks for clarifying this.
Thanks for clarifying this.