In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "adding jitter to Unity3D batch pictures". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
A few days ago, the company had a project, because the art did a lot of background images and a large number of gradients were used too much, resulting in a very poor effect after compressing the picture, and the effect of RGBA16 was not ideal, so it would be too wasteful and efficient to use RGBA32. Later found that TexturePacker has a way to add picture jitter, because the project team used UGUI to manually set it one by one, which is too troublesome, so I made a tool. As shown in the following figure, you can obviously see that the effect of the RGBA16 gradient is not good, but the same RGBA16 effect is good with the addition of dithering.
As shown in the following figure, we tested the jitter algorithm FloydSteinberg with satisfactory results.
As shown in the following figure, put the images that need to add dithering into the input folder, and then execute a.sh (shell script under mac) a.bat (batch processing under win) will automatically output the dithered images to the output folder.
Needless to say about the installation of TexturePacker, just pay attention to the installation directory.
A.sh
#! / bin/bash
Project_path=$ (cd `dirname $0` Pwd) project_input= "${project_path} / input" project_output= "${project_path} / output" rm-rf "${project_output}" mkdir "${project_output}" texturePacker= "/ Applications/TexturePacker.app/Contents/MacOS/TexturePacker" cd ${project_input} files=$ (ls ${project_input}) for filename in $filesdo$ {texturePacker} "${project_input} / ${filename}"-format spritesheet-only-- texture-format png-- opt RGBA4444- -dither-type FloydSteinberg-- trim-mode None-- sheet "${project_output} / ${filename}" done
A.bat
Set project_path=%~dp0 set project_input=%project_path%\ inputset project_output=%project_path%\ output set texturePacker= "C:\ Program Files\ CodeAndWeb\ TexturePacker\ bin\ TexturePacker.exe" rd / s / Q% project_output%md% project_output% for / R% project_input%% f in (*. *) do (% texturePacker%% project_input%\% ~ nxf-format spritesheet-only-texture-format png-opt RGBA4444-- dither-type FloydSteinberg -- trim-mode None-- sheet% project_output%\% ~ nxf) pause
Through our test, most of the pictures can be solved by this method.
This is the end of the content of "add Jitter to Unity3D batch Pictures". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.