How can I get this result with pngs?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
eg1

How can I get this result with pngs?

Post by eg1 »

I was able to achieve the image extraction in png and jpg with vectors and graphics, using pdftron SDK.

But I have a new problem:

The pngs extracted are very large in size, 600KB, 700KB, etc. I need transform that to 200 KB max.

p.e. http://demo.olivesoftware.com/Olive/ODE ... ageExt=png

172 KB.

I´ve seen that can be achieved making this:

Image

index transparency in PNG8

Do you know how I can this, using convert? is it possible?

Thank you,
Emmanuel
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How can I get this result with pngs?

Post by anthony »

I am not certain what you are wanting...

Image size reduction,

or an alpha transparency problem.




For the size reduction, the problem may be going from JPG to PNG. JPG is a lossy file format and as such it tends to generate extra colors, and 'ringing' effects (see IM Examples, JPG lossy effects). This means the pixels in the generated JPG image are not very smooth, particularly for almost pure black and white images such as what your example shows. That in tern make compression a lot more difficult.

I sugget you filter the image though -normalize, or maybe -contrast-stretch 4% to try and remove the color noise, and then it should compress much better. Also run the result though optipng or pngquant (see IM Examples, PNG Other Utilities



If it is a transparency problem, You will need to be more clear of exactly what you are trying to do.

For a gray-scale (mostly black and white image) in an PNG with black on transparent then I suggest using -negate -background black -alpha shape to do the conversion. This uses the source gray-scale image as a transparency mask to generate a pure black 'shape' image, which is black on transparent!

For more info in 'shape' images see Alpha shape and
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply