Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF Screenshots, and how to best share them  (Read 1195 times)

Momaw

  • Bay Watcher
    • View Profile
DF Screenshots, and how to best share them
« on: February 23, 2007, 02:43:00 am »

I know I'm probably in a horribly small minority in being on dialup internet, but even for those with fast connections, it doesn't make any sense to spend bytes where they aren't needed.

So, I'd like to discuss images with you. The short and quick answer is that PNG is best for Dwarf Fortress screenshots...  Read on for the actual whys and wherefores.

Images are defined by two major attributes.  Their resolution, and their depth.  The resolution is how many pixels the image is in width and height, while the depth is a measure of how many bits are used to assign a color to each pixel:  the more bits, the more subtle the colors that are possible.

Dwarf Fortress screenshots really can't be much reduced in resolution, because the finer details would become lost.  That would be useful for very general things, like the overall rough shape of your fortress, but not "close ups".

Where you can save a lot of file size, though, is depth.  Dwarf Fortress, in text mode, only uses 16 colors, which is 4 bits of information. Most Windows desktops are running in 32 bit color, which is enough information to display several millions of different colors.

Now let's talk about file formats. Image file formats come in two types:  compressed and uncompressed.  Uncompressed images, like bitmaps (BMP) or targa (TGA), are very large and should never be used on the internet. Compressed images come in two flavors:  lossy, or lossless.

Lossy compression means that the program doing the compressing will "throw out" pieces of the image, to make it compress more effeciently. Lossy-compressed images are only approximations of the original image, but are usually good enough.  Lossless compression means that the program will create an exact copy of thhe image, only compressing what can be done without changing the image.

Lossy compression works best for, and is mainly aimed at, photographs: where the image has a lot of gradients and soft transitions. It tends to do very poorly on line art, which has sharp edges and abrupt colors,  which is where lossles compression comes into play.

The most popular type of lossy compression is JPEG. JPEG files are always 24 bits deep, and have variable amounts of compression which is set when the file is saved.

This is what JPEG looks like at a low level of compression. It doesn't look too bad, but if you examine it closely there's some fuzziness (the technical term is "artifacting") that reduce the sharpness of the lines.

(38,521 bytes)

Here's JPEG at a high compression setting.  Horrible. But it does do its job at cutting the file size.

(6,255 bytes)

JPEG can be made "effectively lossless" by setting a low compression rate, and by setting the sample size to 1x1.  JPEG also has a "true lossless" setting, but it isn't very well supported so don't bother.

(81,180 bytes)

GIF is an older lossless image format, notorious for its ability to be animated.  GIF images can only have up to 256 colors in them, including transparent ones.

(16,730 bytes)

PNG is a lossless image format that can support many more colors than GIF can.  PNG cannot be animated, but supports a full alpha channel (variable transparency). This is a 4-bit (16 color) PNG image.

(12,352 bytes)

So.  Given the nature of your average Dwarf Fortress screenshot (sharp lines, few colors),  4-bit PNG files are the most sensible file type, as they give perfect quality in a very small file.

Where this may cause problems is in the more exotic graphic tilesets since these can use many colors. If you're using a lot of complex graphics, consider using 256 colors instead of 16.  256 colors is still plenty to convey a high quality image. Consider:

24-bit (16.7 million colors) PNG

(116,307 bytes)

Versus

8-bit (256 colors) PNG

(38,734 bytes)

66% reduction in file size for a barely-noticable drop in image quality.  Good trade in my book.

Logged

Poil

  • Bay Watcher
    • View Profile
Re: DF Screenshots, and how to best share them
« Reply #1 on: February 23, 2007, 05:45:00 am »

Can Paint save in 8-bit PNG?
Logged
[DEMONLORD]

herrbdog

  • Bay Watcher
    • View Profile
Re: DF Screenshots, and how to best share them
« Reply #2 on: February 23, 2007, 02:47:00 pm »

Wow, I couldn't have said it better myself. As an electronic prepress specialist (graphic artist to most of you), I deal with this ALL THE TIME. Great explanation.

PNG's are my favorite too. =D And the BEST.

Logged

Momaw

  • Bay Watcher
    • View Profile
Re: DF Screenshots, and how to best share them
« Reply #3 on: February 23, 2007, 03:09:00 pm »

I don't know about Windows XP's version of Paint since I don't have XP; but 2000's version of Paint doesn't save as PNG, nor does it allow any color depth choice besides B&W or "colors" whatever that means.

There's probably many free programs out there that can help, and I'd be grateful to anybody that can toss up a link and quick tutorial.

I know that "GIMP" is free, and can save as a PNG image. It is perhaps a larger, more complex program than most people want to mess with however. http://gimp-win.sourceforge.net/stable.html

1. Take your screenshot with the screenshot key

2. Start GIMP

3. File -> Acquire -> Paste As New

4. Image -> Mode -> Indexed

5. Choose "Generate optimum palette", and set the "Maximum number of colors" to 16. Click ok.

6. File -> Save

7. Choose a name, folder, and set the type to PNG. Click save.

8. The default PNG options are fine, just click ok.

Logged

Poil

  • Bay Watcher
    • View Profile
Re: DF Screenshots, and how to best share them
« Reply #4 on: February 23, 2007, 03:56:00 pm »

Sounds a bit complicated. I have Photoshop 7 but I prefer to use Paint if I can because it's a lot faster.
Logged
[DEMONLORD]

Eiba

  • Bay Watcher
    • View Profile
Re: DF Screenshots, and how to best share them
« Reply #5 on: February 23, 2007, 06:06:00 pm »

Ah, thanks for a link to that program...
After fiddling around with it for a bit, I figured out how to do everything it in that I ever did in paint...
Any pictures of Dwarf Fortress I upload in the future will probobly be treated by it in the manner you recomend.
Logged

Maximus

  • Bay Watcher
    • View Profile
Re: DF Screenshots, and how to best share them
« Reply #6 on: February 24, 2007, 04:56:00 am »

PNG is perfect for Dwarf Fortress screenshots, but there's something even better: properly compressed PNGs.  I've seen players post PNGs of exported worlds/fortresses that were 500k-1000k that could be recompressed to about 300k.

Unfortunately, all the good PNG recompressors are command-line-only programs, which means you have to know how to run DOS programs to use them.  PNGOUT.EXE is not bad, though, and PNGGauntlet uses the Windows interface as long as you have .NET installed.

Logged

Leerok the Lacerta

  • Bay Watcher
  • Linuxer
    • View Profile
    • The Online Journal of Leerok the Lacerta
Re: DF Screenshots, and how to best share them
« Reply #7 on: February 24, 2007, 08:55:00 am »

Stick them on http://2ch.ru/hr  I say, this way we can see all the images in one place.

And PNGOUT is quite good. I use it for all screenshots when I have it available.