SFML community forums

Help => Graphics => Topic started by: ThreeDumps on April 30, 2012, 11:03:23 am

Title: How to save sf::Image with other than 72 ppi?
Post by: ThreeDumps on April 30, 2012, 11:03:23 am
Everything is in my question.

I can load *.png file with 300 ppi, but when i save it, i get file *.png with 72 ppi. It is option to change that ?
Title: Re: How to save sf::Image with other than 72 ppi?
Post by: Laurent on April 30, 2012, 11:18:00 am
More pixels per inch means more pixels. So just increase the size of whatever you're saving.
Title: Re: How to save sf::Image with other than 72 ppi?
Post by: ThreeDumps on April 30, 2012, 11:25:33 am
Why increase size?

I load 1000x800 with 300 ppi and when I save it, I will get 1000x800 with 72 ppi.

This is problem, becouse when you print it, you will get other sizes.

Even if you  throw it to Word file, you will get different sizes.

1000x800, 300ppi is smaller! in word then 1000x800, 72 ppi, so i should reduce size of 1000x800, 72 ppi, but i will lose quality.
Title: Re: How to save sf::Image with other than 72 ppi?
Post by: Laurent on April 30, 2012, 11:39:39 am
So you would like to set the "resolution" field of the saved PNG's metadata, so that when you open the image in a "page" editor, it is interpreted at a chosen resolution and thus have a correct size, instead of the default one of 72 ppi? Is that what you want to do?

SFML is not able to do that (metadata are not supported), you would have to change it after saving it, with a dedicated editor.