-
Resize Image File???
I am trying to resize an image in C++ if it can be done. I am using Dec-C++. Here are some questions I have:
1. How do I get an images Width & Height with C++?
2. How do I resize the image to any desired Width & Height?
Thanks for any help in advance and sorry if I'm asking for too much.
-
Depends on the image type.
-
To be a bit more specific. Images are stored in various formats. BMP, the typical Windows Bitmap. GIF, the CompuServe image format. JPEG, the Joint Picture Experts Group's image format. PNG, the Portable Network Graphic. The list goes on and on, but these four are probably the most common.
Each format is completely different and thus needs to be read and written in its own unique way.
Once you have the image data read, you have to resize it. For making the image smaller, this means cutting pixels out or combining several into one. For making the image larger, this means adding pixels.
There are many algorithms to do these things. Usually, the better the quality of the resizing, the slower the algorithm.
-
the bottom line is, the C++ standard does not include any specification for image manipulation (and probably never will). you will have to either research the target file format and develop your own processing techniques or else locate a suitable third-party library to handle the low-level stuff.
-
Thanks for the info. I am resizing jpg images if that makes any difference.