A question for Graphic Artists

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
musical74
Eileen-Class Veteran
Posts: 1021
Joined: Sat Dec 18, 2004 6:13 pm
Location: Oregon
Contact:

A question for Graphic Artists

#1 Post by musical74 »

OK OK others too, but figure they will have a better idea than the others...

What's the difference between a photo in .jpg, .bmp, and .png BESDIES how much space they eat up? Or is that the only real difference between them all? When I do make a game, want it to be not so much of a *space hog* because of the pictures...so which one works best, and why?
A friend is one that walks in when the world walks out.

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#2 Post by DaFool »

Uh, who on earth uses .bmp? :shock:
I use .jpg for bg pictures that don't require transparency, with optimized space / detail ratio.
I use .png for sprites that require transparency, so the bgs can show through.

That's it...I guess.

yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#3 Post by yummy »

What you're talking about is basically about image file encoding.

The most basic one in your list is the Bitmap (*.bmp), which size depends on the color depth of the image. Usually, bitmap based files are not compressed, thus they have a good quality. Expect your images to be in megabytes when you use bmp.

Jpeg (or jpg) and Png are both lossy formats, because they compress image files, using their own encryption algorithms.
The most used is indeed jpeg, but it is a Great Destroyer. I mean, when you use jpeg, you file weights a few kilobytes, but there might be a great loss of quality. It's great for images that don't require high quality, such as clouds, colorful landscapes that aren't zoomed up...

I'd recommend using png compression, it is the less destructive and there is also cases where the compression isn't lossy at all. Plus, with png you can use transparency, and jpeg doesn't allow you to do so. Files in png format generally weight about a few kilobytes (about 600kb for a 800x600 24bit file for exemple).

Assets and drawbacks:
BMP > lossless, space hog
JPG > destructive, light weight
PNG > alpha handling (transparency), relative light weight, interlacing, reuse for further editing

For more details:
http://en.wikipedia.org/wiki/Png
http://en.wikipedia.org/wiki/Jpg
http://en.wikipedia.org/wiki/Windows_bitmap

F.I.A
Miko-Class Veteran
Posts: 546
Joined: Wed Sep 21, 2005 10:49 pm
Projects: Winter Shard, EVE, Hyperion
Contact:

#4 Post by F.I.A »

If I am not wrong, commercial companies use bmp format for their cgs, due to the fact bmp allows the perfect display of the work without compacting it. Using formats such as png and jpg in general will compact the picture to minimize the size, with the latter being the most compact(But can cause some mess). That's why they can fill up a 650 mb of a cd without a problem. :P

Well, here are the formats I come across, and their nature in general(NOTE: This is typed without any references beforehand(Only by my experience and reading). So it might have some mistakes here and there.):

1) BMP - The best format as the artwork is not compacted it any way. However, it is the most hefty in the matter of sizing.

2) PNG - Slightly compacted than BMP. Highly related to spriting, as PNG allows color palette support.

3) PICT - A rare format in spriting. Quite similar to PNG in general, but it is more tolerable on file size.

4) GIF - A format most common for an animation. However, if used for an artwork, it is suitable for B&W for lesser anti-aliasing and near-neighbour.

5) JPEG/JPG - The most compact, and also the one with the most anti-aliasing and near-neighbour. Most companies avoid from using it as this format degrades the work save by save. Frankly, everytime you save, the more anti-aliasing and near-neighbour effect is performed.(NOTE: Of course, you can avoid JPEG's continous compaction problem by only saving once.)

Generally, JPEG/JPG or GIF is used in displaying on a browser. I will recommend PNG format in most every other occassion.

[EDIT: Aye, Yummy beat me to my explanation]
「通りすがりのメーカだ。覚えとけ。」

----------
Winter shard
Image
WIP: Hyperion(Trace unknown), ?????(Progressing)

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#5 Post by PyTom »

PNG compression is always lossless... it's basically the same compression Ren'Py uses on the text of the game, applied to image data. There's no reason to use BMP over PNG for anything, as it will bloat your game and produce no quality improvement.

PNG also supports an 8-bit alpha channel.

JPG is lossy, which can produce smaller images in exchange for removing some of the data in the image. Hopefully, the data removed will not be perceptible to the human eye... well, that's the theory (and the quality slider).

JPG has problems with sharp lines and points, it's an artifact of the the way the thing works.

When making a game, work in PNG. When the time comes to release the game, you should strongly consider converting the background images to JPG, depending strongly on what they are of and how the compression affects them.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

#6 Post by Jake »

PyTom wrote:PNG compression is always lossless...
To be fair - PNG compression is always lossless, but "saving an image as a PNG file" can reduce the quality if you choose to save a full-colour image as a paletted PNG, where you only have a small number of colours to use (equivalent to saving as a GIF, which is also paletted).

Of course, the same is true of BMPs, TIFFs, and any other format which supports saving a paletted limited-colour file, but I suspect that this is probably where the false impression that PNG is lossy comes from.
Server error: user 'Jake' not found

User avatar
papillon
Arbiter of the Internets
Posts: 4107
Joined: Tue Aug 26, 2003 4:37 am
Completed: lots; see website!
Projects: something mysterious involving yuri, usually
Organization: Hanako Games
Tumblr: hanakogames
Contact:

#7 Post by papillon »

Mild OT, but another reason to know the difference -

In Game Maker, images stored internally are stored in some GM-specific format, which most people don't know the details of, but the size of which is strongly dependent on the number of pixels of *different colors* in the original image. Therefore, for Game Maker developers, one of the worst things you can do filesizewise is store a large jpeg inside the exe. jpeg compression naturally adds extra colors - even if they may not be visible to the human viewer of the file - and a jpeg background stored INSIDE the game will bloat the exe. With an 800x600 image, the jpeg may be much much smaller than the gif, but loaded into the exe, the exe using the gif will be much much smaller than the version using the jpeg, because the gif is constricted in how many colors it can have.

Which is another reason why I often ship my backgrounds outside of the exe and load them into the game while it's running.

Post Reply

Who is online

Users browsing this forum: No registered users