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:
index transparency in PNG8
Do you know how I can this, using convert? is it possible?
Thank you,
Emmanuel
How can I get this result with pngs?
- 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?
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
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/
https://imagemagick.org/Usage/