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

Author Topic: SFML screenshot quality  (Read 3590 times)

0 Members and 1 Guest are viewing this topic.

tntexplosivesltd

  • Full Member
  • ***
  • Posts: 163
    • View Profile
SFML screenshot quality
« 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!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML screenshot quality
« Reply #1 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.
Laurent Gomila - SFML developer

tntexplosivesltd

  • Full Member
  • ***
  • Posts: 163
    • View Profile
SFML screenshot quality
« Reply #2 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML screenshot quality
« Reply #3 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.
Laurent Gomila - SFML developer

tntexplosivesltd

  • Full Member
  • ***
  • Posts: 163
    • View Profile
SFML screenshot quality
« Reply #4 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML screenshot quality
« Reply #5 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.
Laurent Gomila - SFML developer

tntexplosivesltd

  • Full Member
  • ***
  • Posts: 163
    • View Profile
SFML screenshot quality
« Reply #6 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

 

anything