Crossroads -> RE: Developer Diary #6 - 2D NATO symbols and chit sets in "Middle East" (1/17/2015 9:00:42 AM)
|
quote:
ORIGINAL: Crossroads Scaling down the graphics is the next topic though. A lot of pain, not much fun. But need to be done. Preparing the zoom-out versions of the NATO icons in Icons7d.bmp What needs to be done is simple enough: quote:
- For 2D Normal View (6d), scale down the icons7d.bmp (2D Zoom-In View) by 75% - For 2D Zoom-Out view (2d), scale down the icons7d.bmp (2D Zoom-In View) by 50% - For 2D Extreme Zoom-Out view (1d), copy the icons2d.bmp (2D Zoom-Out View), and get rid of the boxes framing the icons. That is right, while Extreme Zoom-Out (1d) is 25% of Zoom-In view, there's a litte trick with the NATO icons in it: the 2d file symbol contents can be squeezed into small 1d chits as-is by just leaving the rectangular borders out. Unfortunately, when you compress stuff, you lose information. And here's why it all becomes a bit of a pain: The ugly magenta background color in the images I've posted? It defines the transparent background color, in this case magenta. Yes, there is an option: the color present at pixel at 0,0 defines the transparent color. That exact color, and that color only. When the engine first draws the map, and then draws the chits, and then draws the graphics inside chits, the images in these 64x64 pixel grids (in Zoom-In view) are drawn for the parts that are not in the exact color code of the color chose to present transparency (in the pixel at 0,0). This is why magenta is often chosen: if the colors "leak" into the completely drawn map view, you know there's an issue somewhere. And why they leak is that it is impossible to compress pictures without losing information. Consider the task of having two numerals and then merging them into one. "0.0" and "1.0" for an example. quote:
The graphics tool will use a method for that known as anti-aliasing. With anti-aliasing in place, the compression will done using an algorithm that comes up with the best presentation for merging two numerals (think pixels with colors). There's a few options for Anti-aliasing algorithms in graphics tools, all with their strengths and weaknesses, but I will simply talk about anti-aliasing in general. With anti-aliasing ON, the obvious result in this simple scenario is 0.0 and 1.0 become 0.5. Accordingly, if 0.0 is black and 1.0 is white, 0.5 is a middle level grey. Without anti-aliasing, what your graphics tool often specifies as No Anti-aliasing / No Interpolation option or Nearest neighbour interpolation option, you instead define that no new information is to be brought in. If 0.0 is black and 1.0 is white, then the single merged pixel will be either black or white, never grey. Why would you do that? To prevent color leaks in scenarios like how transparency is defined here. In this image, I've compressed the 100% Icons7d.bmp snippet into 50% size, first with anti-aliasing ON, then OFF. I then scaled the compressed 50% versions back to 100% size so they are easier to see. What you see here though is first the 100% sized snippet, then the resulting two 50% sized compressions of the original snippet: [image]local://upfiles/32195/5B049CA89906454F9B3FAD5FFF07C150.jpg[/image] When you look at the resulting images in detail, you can see how the NATO icon edges have been smoothed (that's the "anti-aliasing" in action) in the second sample. There is some dark magenta hue there where the icons meet with the background color, while the icons themselves have been carefully transferred into smaller ones, maintaining a lot of information. So when you take the resulting image into play, you have nice looking smaller icons, but the edges leak some ugly magenta hues into map as well, for the magenta hue there is not the exact magenta present at pixel 0,0. Solution? Either choose a background color not in magenta but say in beige or light grey, that fits with the maps, and these "color leaks" won't be that visible. Or fix the smoothed edges manually, and keep the magenta background to see if there indeed are "any leaks" anywhere. We chose the latter approach, as the chits and icons need to be spot on. Lots of manual work to fix these, no two way around it. Of course, if the compression is smaller, with anti-aliasing off you might get away with the loss of information. Clearly, in this case it is not an option. For instance, if you look at the armored light AA unit (second image on second row), it is still very much recognizable in the middle with 50% reduction in size, where as in the third sample it is no longer a fighting unit but a smiling polar bear (?) instead. There is no two ways about the loss of information in scaling up and down these graphics file. When modding, choose your method, and be prepared to pay the consequences. Again, a lot of boring stuff here probably, but I thought it worth sharing. If (when!) you see "color leaks" in any of the games you play, now you know why!
|
|
|
|