Default file format for screenshots

User avatar
rubberduck
Member
 
Posts: 487
Joined: Thu Feb 27, 2014 19:19
IRC: rbduck
In-game: rubberduck

Default file format for screenshots

by rubberduck » Sun Mar 06, 2016 16:32

The file format for screenshots is png now, but it has the disadvantage of a bigger file size.
This could be changed to jpg, (this is better for posting images on the forum too)
There could be setting for a default file format, if you want to use png instead.
My game (not minetest): http://forum.freegamedev.net/viewtopic.php?f=22&t=6800

my mods: gold_and_gem, meseconductors

a penguin throws an apple through a window

sometimes i change my "forum location" via user control panel
 

User avatar
MineYoshi
Member
 
Posts: 4267
Joined: Wed Jul 08, 2015 13:20
GitHub: MineYosh
IRC: MineYoshi
In-game: Kirby_Retro

Re: Default file format for screenshots

by MineYoshi » Sun Mar 06, 2016 19:00

i don't know why the question, the format of screenshots is png and everyone don't say nothing about it because is normal, png is a good format.

And what happens with the image size,in really that means a better definition and quality!
People talk about freedom of speech, so i'll say that God exists.
Open your eyes!! See The big unicorn conspiracy.!! :D The government has been lying to us about unicorns!!
"I've learned there are three things you don't discuss with people: religion, politics and the Great Pumpkin" - Linus Van Pelt
I'm the Officially 1st ABJist in the world ( ͡° ͜ʖ ͡°)
 

User avatar
firefox
Member
 
Posts: 1185
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox

Re: Default file format for screenshots

by firefox » Mon Mar 07, 2016 07:19

jpg files have a quality issue.
every time you edit and save them, the quality will decrease.
png files will stay the same.

i don't know the exact details, but jpg images don't support all the stuff that the png format has, so the image is downgraded and simplified when saving it as a jpg. this process will repeat with every save, reducing the image quality.
 

User avatar
oleastre
Member
 
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: Default file format for screenshots

by oleastre » Mon Mar 07, 2016 08:39

If you want some background, jpeg is a lossy format; it means that to achieve better compression, it removes some information from your image, based on the fact that human eye does not react to every colors in the same way. That kind of compression can create "artifacts" in the image, that results in some visible blocks. And jpeg is quite bad with large patch of the same color.

On the other side, png is a lossless format, it encodes every details of your image, in the trade of file size. But png is quite good at it's job.

If you want to compare, I did a screenshot in minetest and saved it two times, one in png and one in jpeg (with quite low quality). Then I enlarged both and here is the result:
PNG: Image

JPEG: Image

So, for a game like minetest, you would be quite disappointed if the default image format would be jpg; no way to get a good quality screenshot.
And so, yes png is the best format in that case; and supporting another export format means adding options (format, compression quality), another library as dependency, and code to maintain...

And probably at the end, you will open the screenshot before posting it to a web site; either to resize it or to add some watermark or ...

My opinion is that it's probably better to focus on other part of the engine before the screenshot format :) (but who knows, if you come with code and a pull request...)
Attachments
screenshot.png
png extract
screenshot.png (69.99 KiB) Viewed 2719 times
screenshot-jpg.png
jpg extract
screenshot-jpg.png (62.06 KiB) Viewed 2720 times
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Default file format for screenshots

by Morn76 » Mon Mar 07, 2016 11:23

The JPEG format isn't inherently lossy, it entirely depends on the quality setting when saving.

MT could save as 100%-quality JPEG by default. That would basically be the same as PNG, i.e. there would be no JPEG artifacting.

If JPEG quality were a configurable parameter in minetest.conf, users could set it to e.g. 80 or 85% to get smaller JPEG files for the forums. That would save one conversion step from PNG to JPEG.
 

User avatar
oleastre
Member
 
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: Default file format for screenshots

by oleastre » Mon Mar 07, 2016 11:38

Just do a simple test: save a minetest screenshot as a jpg file with quality set to 100%; open it in your favorite image editor alongside the png version.
Put the two images in different layers and do a difference between the two.
After that, just boost a little bit the brightness to see something.

Here is the same screenshot where I applied that method:
Image

Jpeg does a Fourier transform of the image, and encodes rgb values as luminance (luminosity) and chrominance (color), with more details for luminance (as the human eye is more sensible to that) than for chrominance. All of this introduces loss of information and approximations, even at 100% quality.

So for the best quality, you need a true lossless format; ie png.
Attachments
lossy.png
lossy.png (29.78 KiB) Viewed 2719 times
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Default file format for screenshots

by Morn76 » Mon Mar 07, 2016 12:59

Without a scale that tells us what the colors mean, that image does not tell us the absolute size of the error introduced by saving as 100% JPEG.

If e.g. errors are ±1 in R, G, B each on a scale of 0 to 255, then I think it's close enough to call it lossless for our purposes.

The question is whether the naked eye can see a difference. Subtracting in Gimp and boosting contrast of the difference is not the same as the capabilities of the human eye.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Default file format for screenshots

by Linuxdirk » Mon Mar 07, 2016 13:21

Morn76 wrote:Without a scale that tells us what the colors mean, that image does not tell us the absolute size of the error introduced by saving as 100% JPEG.

But in fact it shows that “100% quality JPEG” is still lossy. It doesn’t matter ow much information you lose … you just lose information when using JPEG.

For publishing images JPEG is currently the best format available because it’s supported by all relevant browsers withoiut any problems and can be viewed using almost any relevant operating system available.

For unprocessed material grabbed from the source there should always a lossless format should being used. An established lossless format for images is PNG – You can crop, scale and edit it as you want without having a lower quality to start with than the source provides. Export it as JPEG and publish it as you want.
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: Default file format for screenshots

by twoelk » Mon Mar 07, 2016 13:48

Fact is JPG deletes all information and replaces it by calculating something the eye thinks looks similar enough to normally not notice any difference. Even with quality set to 100% the original information is destroyed and replaced by a detailed calculated version. PNG keeps every pixel information and is therefore much more usefull if you need to edit the picture. Keep in mind that changing the size of a picture is also editing the content. From a JPG there is no way back to the original information. JPG's do not store single pixel information - that is the reason that a JPG picture may look different in various programs and on different platforms. How a JPG is presented is calculated from the saved file and not read.

Simplified to the extreme you may think of JPG'ng a picture as splitting the picture in tiles of say 9 by 9 pixels. Next you store the values of two pixels on opposing corners and delete the rest. You now store the information which is only about a third of the original. When you open the picture you set up the tiles with the two pixels as extreme values and calculate a transition between the two. You then fill the remaining pixels with the calculated values. Of course it is a little more complicated than that but you might get an idea what "lossy" format means. For example JPG is extremely bad with sharp high contrast borders such as in black text on white background.

JPG is good enough for photos but not really good for professionals who rather use PNG or even TIFF. For pixel drawings, pictures with large areas of the same color, pixel exact borders or limited colors PNG or even GIF is by far the better choice.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: Default file format for screenshots

by Morn76 » Mon Mar 07, 2016 14:19

Well, I'm not personally against supporting multiple screenshot file formats, e.g. PNG and JPG, preferably the latter with a user-selectable quality setting. Personally I will switch to JPG as soon as the MT git version supports it, because right now both the original PNGs and converted JPGs are hogging hard disk space without a real benefit.

That said, even valuable scientific data today is routinely converted to and archived using slightly compressed/lossy formats, e.g. GRIB, JPEG 2000, etc. So I think your are making a mountain out of a molehill error that is on the same order as a rounding error (and probably mostly _is_ a rounding error from the forward and inverse Fourier transform.) I certainly understand the slight benefit of PNG, but I was also considering the benefit of keeping MT's code base and config options as simple as possible.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Default file format for screenshots

by Linuxdirk » Mon Mar 07, 2016 15:57

Morn76 wrote:… but I was also considering the benefit of keeping MT's code base and config options as simple as possible.

… and that means: Use the best supported available lossless image format for screenshots only and let the users process the images manually instead of adding multiple export formats.
 

User avatar
rubberduck
Member
 
Posts: 487
Joined: Thu Feb 27, 2014 19:19
IRC: rbduck
In-game: rubberduck

Re: Default file format for screenshots

by rubberduck » Mon Mar 07, 2016 19:06

Ok, i think now, that is a good idea. So this feature is not needed anymore.
My game (not minetest): http://forum.freegamedev.net/viewtopic.php?f=22&t=6800

my mods: gold_and_gem, meseconductors

a penguin throws an apple through a window

sometimes i change my "forum location" via user control panel
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Default file format for screenshots

by kaeza » Mon Mar 07, 2016 22:11

https://github.com/minetest/minetest/pull/3826

Trivial change, everybody's happy.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
MineYoshi
Member
 
Posts: 4267
Joined: Wed Jul 08, 2015 13:20
GitHub: MineYosh
IRC: MineYoshi
In-game: Kirby_Retro

Re: Default file format for screenshots

by MineYoshi » Mon Mar 07, 2016 22:43

Well i think this is clear now, Minetest have PNG format screenshots and is better don't change it to JPEG because becomes a lossy format, if you upload it, his quality decrease!

So i think better left MT screenshot system how is, and better go and do other thing instead!
People talk about freedom of speech, so i'll say that God exists.
Open your eyes!! See The big unicorn conspiracy.!! :D The government has been lying to us about unicorns!!
"I've learned there are three things you don't discuss with people: religion, politics and the Great Pumpkin" - Linus Van Pelt
I'm the Officially 1st ABJist in the world ( ͡° ͜ʖ ͡°)
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Default file format for screenshots

by kaeza » Sun Mar 13, 2016 13:04

FWIW, Option is now in core and will be available in the upcoming release.

Enjoy.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
MineYoshi
Member
 
Posts: 4267
Joined: Wed Jul 08, 2015 13:20
GitHub: MineYosh
IRC: MineYoshi
In-game: Kirby_Retro

Re: Default file format for screenshots

by MineYoshi » Sun Mar 13, 2016 23:19

...

I will see how works that out...
People talk about freedom of speech, so i'll say that God exists.
Open your eyes!! See The big unicorn conspiracy.!! :D The government has been lying to us about unicorns!!
"I've learned there are three things you don't discuss with people: religion, politics and the Great Pumpkin" - Linus Van Pelt
I'm the Officially 1st ABJist in the world ( ͡° ͜ʖ ͡°)
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Default file format for screenshots

by Sokomine » Thu Mar 17, 2016 02:32

kaeza wrote:FWIW, Option is now in core and will be available in the upcoming release.

Thank you! A tiny change but a great help - at least for me. The screenshots now take up far less disk space. And: Sending them over the internet takes far less time. All these huge screenshots around here (which nobody ever scales down to a reasonable size) take a long time to load with a not-so-fast connection. I've given up taking a look at Jordachs blender renders because loading the thread takes eternity :-(
The vast majority of MT screenshots will be fine with jpeg instead of png format. Savefiles of entire buildings are easily by a factor of 10 smaller than the 2d screenshot showing the building. That will continue to remain so with jpeg, but at least the screenshots can be a bit smaller now.
A list of my mods can be found here.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Default file format for screenshots

by kaeza » Thu Mar 17, 2016 03:16

MineYoshi wrote:...

I will see how works that out...

The default format is still PNG. Unless you specifically went look for the option, you wouldn't even know that JPEG, TGA, PCX, and PPM formats are available (JPEG even has a quality setting). So no loss if you don't care, but very convenient for those that prefer (waaaaay) smaller files to pixel-perfect quality (both for storage and transfer), but don't want to deal with converting images manually. Great convenience at the expense of trivial changes which have no effect whatsoever in terms of memory or CPU usage? I would take that any day.

Sokomine wrote:Thank you! A tiny change but a great help - at least for me. The screenshots now take up far less disk space. And: Sending them over the internet takes far less time. All these huge screenshots around here (which nobody ever scales down to a reasonable size) take a long time to load with a not-so-fast connection. I've given up taking a look at Jordachs blender renders because loading the thread takes eternity :-(
The vast majority of MT screenshots will be fine with jpeg instead of png format. [...]

You are quite welcome, and count me in too. :)
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
MineYoshi
Member
 
Posts: 4267
Joined: Wed Jul 08, 2015 13:20
GitHub: MineYosh
IRC: MineYoshi
In-game: Kirby_Retro

Re: Default file format for screenshots

by MineYoshi » Thu Mar 17, 2016 19:39

Wow....
People talk about freedom of speech, so i'll say that God exists.
Open your eyes!! See The big unicorn conspiracy.!! :D The government has been lying to us about unicorns!!
"I've learned there are three things you don't discuss with people: religion, politics and the Great Pumpkin" - Linus Van Pelt
I'm the Officially 1st ABJist in the world ( ͡° ͜ʖ ͡°)
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 43 guests

cron