Results 1 to 8 of 8
Thread: Best type of image to use?
- 08-15-2011, 02:33 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 48
- Rep Power
- 0
- 08-15-2011, 03:36 AM #2
I don't think there is a difference in their usage once they are loaded into an image object.
- 08-15-2011, 04:55 AM #3
Member
- Join Date
- Apr 2011
- Location
- Kansas
- Posts
- 26
- Rep Power
- 0
If you have transparency you'll probably want gif or png. Just throwing that out there.
- 08-15-2011, 06:43 AM #4
Which ever one you like. I like to use pngs but that is my prerogative. They have the richest looks but you sacrifice memory ( both long term [hard drive] and short term [RAM] memory). A good way to use pngs with your game is to optimize it. If you really want to keep the file sizes small, use gif files. This is just my opinion though.
My API:Java Code:cat > a.out || cat > main.class
- 08-15-2011, 07:17 AM #5
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
I'm no expert, but don't pngs offer better transparency (proper alpha) *and* better compression than gifs?
Of course your code should be written in such way as to be format agnostic. Onnly code that wants to get dirty with the source file's bytes should even be aware of the format - an image is an image not a gif or a png or etc. That being the case you should be able to swap one format for another, measure the difference, and post back with The Answer.
- 08-15-2011, 07:34 AM #6
Oh yes! Pngs are much better with alpha channels than GIFs. Alpha channels are not existent in JPEGs. And since PNGs, gifs, and JPEGs are the most popular, I choose from them most often. BMPs could be used but I never use them. Hey! maybe I am missing out.
What I meant by, a sacrifice in memory, is that PNGs can be full of clutter, so using optimization tools like PNGCrusher and OptiPNG could decrease their size which would optimize your game. Flash and Gimp have a knack for making their PNGs very large in file size.
But besides the initial size of the program itself, once you have loaded the images, it really does not matter. Java is really good with getting all the images ready to be painted to the GUI at any given time.My API:Java Code:cat > a.out || cat > main.class
- 08-15-2011, 08:17 AM #7
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
Ah, I didn't know about pngs being liable to bloat. It doesn't surprise me - I looked over the spec a couple of times and it did seem quite "feature rich". The answer in that case, as you suggest, is to use external tools to make the image data files lean and mean.
Depending on circumstances load time might make a difference. (Although I - speaking with the authority of total ignorance - would suspect that loading across the internet, eg, would depend on how *many* connections had to be made. Go jar!)
- 08-15-2011, 08:17 AM #8
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
Ah, I didn't know about pngs being liable to bloat. It doesn't surprise me - I looked over the spec a couple of times and it did seem quite "feature rich". The answer in that case, as you suggest, is to use external tools to make the image data files lean and mean.
Depending on circumstances load time might make a difference. (Although I - speaking with the authority of total ignorance - would suspect that loading across the internet, eg, would depend on how *many* connections had to be made. Go jar!)
-------
[Edit] Also Norm's point above is good.Last edited by pbrockway2; 08-15-2011 at 08:20 AM.
Similar Threads
-
Trying to convert Java Date to type int to fit in mysql table with field type int(11)
By fortwnty420 in forum New To JavaReplies: 4Last Post: 08-01-2011, 10:29 AM -
How save Image BMP Binary type?
By shakall in forum SWT / JFaceReplies: 3Last Post: 12-22-2009, 01:50 PM -
using instanceof to get Object type and parent type?
By xcallmejudasx in forum New To JavaReplies: 2Last Post: 11-06-2008, 06:24 PM -
[SOLVED] Cast string type to int type
By GilaMonster in forum New To JavaReplies: 9Last Post: 09-17-2008, 10:43 AM -
Display available ImageReaders and ImageWriters by image format and MIME type
By Java Tip in forum java.awtReplies: 0Last Post: 06-23-2008, 11:25 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks