lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.07k stars 422 forks source link

I need to resize the image #35

Closed smratijohri closed 8 years ago

smratijohri commented 8 years ago

hi, this is more of a suggestion from you rather than an issue. sorry for posting in issue but did not a way to contact you. i want to resize the pixel image or bitmap image, but unable to find the function to do so in your library. i am unable to use any other library due to compatibility issues with my hardware. Can you please guide me towards the same or if any function that exist in your library which can help me achieve my goal. Requirement : i have png of (greater than 4mb) i want a bmp file of it which is of 100*100 dimention. please help me its really urgent.

thanks in advance

cosinekitty commented 8 years ago

Out of curiosity, do you need to convert just one large PNG image, or do you need software to automatically do so repeatedly? If the latter, does your system have enough memory to load 4MB+ images? Are the images already square (same width and height)? If not, how do you propose to convert them to 100x100, by cropping or stretching?

I am not the author of lodepng, but I doubt it makes sense to add such functionality to lodepng directly because there are too many variations. The beauty of lodepng is its limited scope; it does a very simple thing and does it very well without overhead of feature bloat. However, it might make sense for someone to write a separate library to perform resizing that depends on lodepng.

lvandeve commented 8 years ago

Hi, Resizing an image is its own specialized topic, LodePNG is focused on decoding/encoding PNG images, while resizing is out of scope. For more information on image rescaling, see for example https://en.wikipedia.org/wiki/Image_scaling. A popular library from the top of my head that can do it is imagemagick, but many other libraries and implementations can be found online. I hope that helps. Since rescaling is out of scope for this library I'll close this issue.