SFML community forums

General => Feature requests => Topic started by: quasius on March 28, 2008, 09:11:02 pm

Title: Actual image resizing
Post by: quasius 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.
Title: Actual image resizing
Post by: Laurent 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 ;)
Title: Still possible
Post by: Caspin 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