-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstructions.txt
56 lines (48 loc) · 3.69 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
STRIPS OF 8 ROWS
----------------
This is what I ended up using.
magick titan256c_indexed.png -unique -depth 8 -colors 256 -crop x8 -define png:format=png8 -define histogram:unique-colors=false titan_0_%d.png
And then use custom implementation of `tiledpalettequant` tool to generate RGB images with palettes ready to be consumed by SGDK's rescomp.
Titan text sphere wraping animation
-----------------------------------
This command reduces colors and convert the image as indexed:
convert animation.gif -background white -depth 8 -colors 4 titan_sphere_text_anim.gif
Then use Aseprite to clean frames and remove repeated colors.
Then reduce to 2 or 3 colors depending on how many colors you expect to leave in the animation
convert titan_sphere_text_anim.gif -background white -depth 8 -colors 3 titan_sphere_text_anim.gif
Then use Aseprite to edit each color position in the palette.
STRIPS OF 4 ROWS
----------------
Strips of 4 rows of valid content, so each final 8x8 tile will have half content as transparent pixels.
Even strips have 4 bottom rows of transparent pixels.
Odd strips have 4 top rows of transparent pixels.
magick titan256c.png -unique -depth 8 -colors 256 -crop x4 -define png:format=png8 -define histogram:unique-colors=false titan_%d.png
for /f "eol=: delims=" %F in ('dir /b /a-d titan_*.png^|findstr /irc:"[02468]\.png$"') do ^
magick "%F" -depth 8 -colors 256 -define png:format=png8 -background transparent -gravity south -splice 0x4 "%F"
for /f "eol=: delims=" %F in ('dir /b /a-d titan_*.png^|findstr /irc:"[13579]\.png$"') do ^
magick "%F" -depth 8 -colors 256 -define png:format=png8 -background transparent -gravity north -splice 0x4 "%F"
magick titan256c.png -unique -depth 8 -colors 256 -crop 8x2 -define png:format=png8 -define histogram:unique-colors=false tiles_to_count_%d.png
magick identify -format "%k\n" tiles_to_count_*.png >> count.txt
del /f /q tiles_to_count_*.png
Post procesing for SGDK usage (NOT USED)
----------------------------------------
After using the commands, each generated image has its own palette.
We need to add at the beginning of each palette a "transparent" first color, mandatory by the SGDK.
We will use black (000). No matter if it's already used in the image.
Create a black 320x1 png image
magick -size 320x1 xc:black -depth 8 -colors 256 -define png:format=png8 black_row.png
Append the black_row image as a top row
magick -depth 8 -define png:format=png8 black_row.png input.png -append output_blackrow.png
Remove the top black row
convert output_blackrow.png -depth 8 -define png:preserve-colormap=true +repage -gravity north -crop +0+1 output.png
(this ends up adding a white color at the end of the palette because we can not use png:format=png8 and +repage)
Finally run next LUA script using Aseprite command tool to remove trailing white color in palette and black color if transparent background is used
aseprite -b input.png --script remove_unwanted_colors.lua
All commands I used on titan256.png to generate the chunks
----------------------------------------------------------
magick titan256c.png -unique -depth 8 -colors 256 -crop x4 -define png:format=png8 -define histogram:unique-colors=false titan_%d.png
FOR /L %i IN (0,1,55) DO magick -depth 8 -define png:format=png8 black_row.png titan_%i.png -append titan_%i_blackrow.png
FOR /L %i IN (0,1,55) DO convert titan_%i_blackrow.png -depth 8 -define png:preserve-colormap=true +repage -gravity north -crop +0+1 titan_%i.png
(this ends up adding a white color at the end of the palette because we can not use png:format=png8 and +repage)
DEL /F titan_*_blackrow.png
FOR /L %i IN (0,1,55) do (aseprite -b titan_%i.png --script remove_unwanted_colors.lua & ping 127.0.0.1 -n 1 -w 50 > nul)