Solved

Is clipping GIF's in code better than storing the GIF cuts in web-space?

Posted on 2014-12-30
5
128 Views
Last Modified: 2014-12-31
Hi

for my RTS, I have the GIF tiles ready for my map scenery.
I can chop them up from a big image at the beginning or load in each tile one by one.

Is the obvious improvement in loading a GIF once and chopping the sub-images out the best way to go, or is loading in the images pre-cut better?

Thanks
0
Comment
Question by:beavoid
  • 2
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
dpearson earned 500 total points
ID: 40525059
Generally it's better to load 1 large image and pull the image elements from within that.

This is generally known as "texture packing" and makes a big difference if you can load the entire image (a texture atlas) into video memory in one go.  You can read more about it here: http://en.wikipedia.org/wiki/Texture_atlas

I've not personally attempted to do this with a Java front end client, but it's a common technique used with many other rendering technologies.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40525180
HTTP adds heap of latency when loading lots of sprites, so it is best to join them together.
It will kind of be solved with HTTP/2.0, currently known as SPDY or so.
0
 

Author Comment

by:beavoid
ID: 40525446
I am not using HTTP, no text, just extracting the GIF from my domain into memory.
But it's best to make one load of graphics and chop it up? Latency, how? Surely once it is in memory, it is solid?

Thanks
0
 
LVL 62

Expert Comment

by:gheist
ID: 40526273
You can have one huge png resource for all.
0
 

Author Closing Comment

by:beavoid
ID: 40526275
Great
Thanks
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question