New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reminder to remove metadata from textures before each release #1831
Comments
From what I have seen, while looking into this on the gaming level... a file which is 16px/16px will always use the same amount of memory of a graphics card as any other 16px/16px file. The area where reducing the file's size counts, in this case..., is related to the load on the cpu. I plan to start going through all of the textures for all MTG related mods in a few days, one at a time and test each as I go. I also see this is best done on a per file basis, rather than done in a batched process. Which makes sense. |
Seems so. I am no expert. Most MTGame textures have been 'optimised' 1 or more times already, but newer ones may not be, and stripping all metadata is useful. |
I guess it is also relevant to keeping the overall size of the software/project down, each little bit keeps download size and time down. Reading through information on the optipng guide, so many variables involved, and there is still some areas which are being studied because not everything related is even known ha. Anyway, I see it as very simple and straight forward in relation to the needs for MTG textures and I already have a basic process I use but, a lot of interesting reading there. |
What are people's feelings toward using .jpg for all textures which do not use transparency? |
just no |
heh, alrighty then. |
@TumeniNodes JPEG is the worst idea for pixelart, where each pixel should be displayed how it was originally drawn. The smaller or unnatural an image is, the more unsuited it is for this compression method. JPEG takes 8 by 8 pixels, compares it with a value table to figure out the best matching frequencies (DCT) to represent them. So this procedure would happen only four times (!) for one texture file, which logically results in really bad outputs. |
@SmallJoker |
Re-opening for 5.1.0. |
Be sure to set files back to rgb before using optipng, otherwise the file will read as already being optimized. Optipng will set the file to indexed automatically once the optimization is complete. |
Thanks. Once we're approaching release, i hope you can be our texture optimisation person. |
sure, with the understanding I will be referred to as Optimus Prime during that time frame |
@TumeniNodes freeze has started so a good time to do some optimisation if you feel like it. Important: Textures of nodes with drawtype 'allfaces_optional' (leaves) are intentionally RGBA and need to stay that way. |
Yep, already started going through. And I am aware of that drawtype. |
IRC: tumeninodes> Hi paramat, A couple items I cannot recall if we need to leave rgb (grass and snow sides-like textures, signs textures) paramat> ugh, actually i think we have left this too late, freeze is for looking for bugs, so texture changes should have been done before freeze, not your fault, ours. also, such a big change will be hell to review in 1 or 2 days. so, no rush, this may have to wait until after release Additionally, we need time to check which textures need to be RGBA instead of indexed. |
Once we have a list of those which need to RGB, might be a good idea to document somewhere (as a list and not hidden within the API for each drawtype) for any future texture creators or changes being done to existing ones? |
Yes, if any else require a certain form it should be added in this section https://github.com/minetest/minetest/blob/81c2370c8b1a66a279a5ff450c78caf5dfef77bf/doc/texture_packs.txt#L181 'Grass side' type textures are fine as indexed, they all appear ok in-game so if some are indexed all can be. Perhaps you can list here any non-leaves textures that you discover that are RGBA, for consideration? |
Any I come across as I go and with testing, I will certainly list. |
Reopen as reminder for every release. |
I had done most but got completely tied up with real world stuff and Leukemia crap. But, better than setting a reminder to strip metadata prior to each release, make it a mandate for any new texture approvals (problem solved). See how the current PR for this goes. If it goes ok = good, if not I'll just start from scratch and would only take a couple days Go through each individually the one time, and then make it a requirement (just as code has certain requirements for approval) |
No problem, there is no rush to do this, 5.4.0 is distant. I will bump this issue when we are close to release. |
I haven't followed the conversation here, so I'm wondering why not use a simple command to strip the metadata from multiple files and then make the requirement? |
Sometimes batch processes remove more or less than what you intend. Personally, I prefer to go through each, individually, set them back to rgb, remove the metadata, then optimize. |
I forgot to mention, that all the images should be using sRGB as the base profile before indexing, and I have come across some which are RGB, which can also lead to higher file size after indexing. |
I suggest we investigate a compression program carefully, perhaps optipng, and discover the configuration that strips metadata and does nothing else. Then compressing in batch will be ok. |
Compression/optimizing = indexing involved, which as mentioned numerous times now, does not work for allfaces drawtype. But this is just the difference between programmers and artists. optipng for me is the most reliable and easy to use. Either way, I'm picking a day next week to finish up the folder I had set aside, and was already 1/2 through. |
Ok cool, go for it. |
Obligatory 5.4.0 bump. |
Often useless metadata gets included in textures so this should be removed.
However, it is important to make sure the compression only removes metadata and does nothing else.
Usually, a compression program will convert RGBA textures to 'indexed colour' mode, this breaks leaves textures ('allfaces_optional' drawtype) as the transparent pixels have important colour information that is used when rendered as opaque.
The text was updated successfully, but these errors were encountered: