Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to save sf::Image with other than 72 ppi?  (Read 1921 times)

0 Members and 1 Guest are viewing this topic.

ThreeDumps

  • Newbie
  • *
  • Posts: 34
    • View Profile
How to save sf::Image with other than 72 ppi?
« 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 ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to save sf::Image with other than 72 ppi?
« Reply #1 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.
Laurent Gomila - SFML developer

ThreeDumps

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: How to save sf::Image with other than 72 ppi?
« Reply #2 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to save sf::Image with other than 72 ppi?
« Reply #3 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.
Laurent Gomila - SFML developer