Jump to content
Sign in to follow this  
Clément

Processing PNG image

Recommended Posts

Hi,

 

Happy XMas!

 

I must read a bunch o PNG images to my program and store them in a database. The pictures (PNG) have different height and width, and I must process them in order to keep all of them in 600x600.
For example: I read a PNG image 704x404, I must cut 704 -> 600 and a must fill 404 -> 600 , without loosing transparency. I have some ideas of how to do it, but it must be "fast" and correct.

Any ideas?

Share this post


Link to post

Clement, there are a number of Delphi graphics libraries that will do what you want, so my answer would depend on the graphics library you're currently using. (IOW, it generally easiest to stick with what your familiar unless there's a good reason to change.)

 

Edit: What you're generally looking for are image resampling algorithms, of which there are many. But, as almost always, there must be compromises between speed and image quality. And when you're down-sampling (ie making images smaller), then for quality I'd strongly recommend a down-sampling algorithm over a general image resampler.

 

Bon Noël 🎄

Edited by angusj
  • Like 1

Share this post


Link to post

In addition to native libs there's very powerful opensource ImageMagic project that could be called as lib or an external app.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×