[SOLVED] command line script to change resolution of png files
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
command line script to change resolution of png files
Hya,
I am looking for command line script to change resolution of png files.
I have a lot of png files to change resolution for quality printing. I know how to do using application program, but too many.
These are what I have: 1280 x 960 png files (povray output), when I open them photoshop or some other applications, they are 72dpi.
I need these files to be 600dpi. Output format does not have to be png, but prefer to be png.
How will increasing 72dpi to 600dpi increase the quality of these png's? The pictures were taken at some resolution. You can't really add resolution to a picture.
Think about it the other way. Pretend you have a picture at 600 ppi (pixels per inch). You want to reduce the resolution to 300 ppi. Basically what the program does is remove every other pixel. If you tried to go from 300 to 600 ppi, you have to add pixels. But what color should each pixel be? Should it just average the adjoining pixels? Should it just split the pixels so that there are twice as many? By increasing resolution, you're trying to add data points.
PS:
pljvalez is correct on both counts:
a) You can't "increase resolution" beyond what the picture was originally taken yet (let's not talk about image processing techniques - that's really not relevant to this discussion)
b) "dpi" (and, for that matter, "ppi") can be confusing. In this context, they really don't necessarily "mean" anything!
But if you want to make the image "smaller" ... or "larger" ... or you want to "sharpen" it - or any of a million other things - then ImageMagick is definitely your tool!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.