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

Author Topic: Actual image resizing  (Read 11822 times)

0 Members and 1 Guest are viewing this topic.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Actual image resizing
« on: March 28, 2008, 09:11:02 pm »
As far as I can tell, it's not possible to actually resize an image in SFML- only change scale factors.  Is it possible to actually scale down an image, discarding the extra data?  If not, would this be a reasonably easy feature to add?
This would be needed if you wanted to offer multiple resolutions and actually save memory by scaling down the art.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Actual image resizing
« Reply #1 on: March 29, 2008, 04:35:45 am »
No, it's currently not possible nor planned.

It could be done if really needed, but not in a near future ;)
Laurent Gomila - SFML developer

Caspin

  • Newbie
  • *
  • Posts: 10
    • MSN Messenger - j_nick_terry@hotmail.com
    • View Profile
Still possible
« Reply #2 on: April 10, 2008, 05:29:38 pm »
This could easily be done by hand.

At game start up use the original image and dither it down to the size that is needed by the resolution and use the newly generate sf::Image instead of the original.

Dithering well is very complex problem.  Do some research before just coding the first thing that comes to mind.  The may even be a generic library that could perform the dithering for you.  The sf::Image is open enough that you should be able to use the raw data or convert it to the needed format.

-nick

 

anything