SFML community forums

Help => Graphics => Topic started by: tntexplosivesltd on May 09, 2011, 02:41:54 pm

Title: SFML screenshot quality
Post by: tntexplosivesltd on May 09, 2011, 02:41:54 pm
Hi there!
Is there any way to specify the quality of a .jpg screenshot when you save it using SFML? I want high-quality screenshots, but I don't want huge bitmap files being created.
Thanks in advance!
Title: SFML screenshot quality
Post by: Laurent on May 09, 2011, 02:53:13 pm
No you can't, unless you recompile SFML. But by default, JPEG quality is set to 90 / 100.
Title: SFML screenshot quality
Post by: tntexplosivesltd on May 09, 2011, 02:54:27 pm
:(
Will changing the quality be available in SFML 2?
What image format can I use that isn't as huge as .bmp?
Title: SFML screenshot quality
Post by: Laurent on May 09, 2011, 03:00:23 pm
Quote
Will changing the quality be available in SFML 2?

Why? 90 is the best compromise as far as I remember, using more produces huge files.

Quote
What image format can I use that isn't as huge as .bmp?

PNG can be good for screenshots, it uses RLE. Which means that:
- it's a lossless compression
- you get a good compression ratio if you have large consecutive areas with the same pixel color

I think TGA does more or less the same.
Title: SFML screenshot quality
Post by: tntexplosivesltd on May 09, 2011, 03:03:24 pm
The screenshots I take with .jpg are not very clear.
I've tried using .PNG, but it saves the background colour (what I have set glClearColor to) as transparent. Can I tell it not to?
Title: SFML screenshot quality
Post by: Laurent on May 09, 2011, 03:09:11 pm
Quote
The screenshots I take with .jpg are not very clear.

Really? Can you show an example?

Quote
've tried using .PNG, but it saves the background colour (what I have set glClearColor to) as transparent. Can I tell it not to?

This is probably because your clear color has an alpha of 0.
Title: SFML screenshot quality
Post by: tntexplosivesltd on May 09, 2011, 03:16:43 pm
Yes! That fixed it!
I guess that the .jpg quality is okay, I must be hard to please  :D