mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-23 16:29:34 +00:00
WIP SHR snowflake effect (not hooked up)
This commit is contained in:
parent
4ca2e6b57b
commit
735a1c7f5d
45
res/notes/transitions/shr_snowflake.py
Executable file
45
res/notes/transitions/shr_snowflake.py
Executable file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import PIL.Image # https://pillow.readthedocs.io/
|
||||
import util
|
||||
|
||||
# snowflake.png is the source image. The source image MUST have a white background,
|
||||
# but other colors and pixel depth are irrelevant. This one is black & white.
|
||||
# Due to the Apple II pixel aspect ratio, we do a 1-time aspect-ratio-losing resize
|
||||
# to squash the image to 92% height.
|
||||
#
|
||||
# $ gm convert snowflake.png -resize "100%x92%!" squash.png
|
||||
# (Depending on your shell, you may need to escape the exclamation point. Grr.)
|
||||
#
|
||||
# Now we can create individual images for each "frame" of the animation, by
|
||||
# resizing the (squashed) source image and putting it in a 280x192 frame.
|
||||
#
|
||||
# $ for w in `seq 1 500`; do \
|
||||
# gm convert -size 160x100 squash.png \
|
||||
# -resize "$w" \
|
||||
# -background white \
|
||||
# -compose Copy \
|
||||
# -gravity center \
|
||||
# -extent 160x100 thumb"$w".png; \
|
||||
# done
|
||||
#
|
||||
# Depending on the source image, you may need more or fewer than 500 frames. This
|
||||
# number is duplicated below in the |frames| variable. Sorry.
|
||||
#
|
||||
|
||||
frames = 500 # number of "thumbN.png" files
|
||||
|
||||
coords = []
|
||||
for i in range(1,frames):
|
||||
p = PIL.Image.open("snowflake/thumb%s.png" % i)
|
||||
for x in range(0, 160//2):
|
||||
for y in range(0, 100//2):
|
||||
if p.getpixel((x,99-y))[0] != 255:
|
||||
coords.append((y*2,x))
|
||||
|
||||
unique_coords = util.unique(coords)
|
||||
|
||||
util.write("../../../src/fx/fx.shr.snowflake.data.a", unique_coords, header="""!cpu 6502
|
||||
!to "build/FX/SHR.FLAKE.DATA",plain
|
||||
*=$9F00
|
||||
""")
|
12
src/fx/fx.shr.snowflake.a
Normal file
12
src/fx/fx.shr.snowflake.a
Normal file
@ -0,0 +1,12 @@
|
||||
;license:MIT
|
||||
;(c) 2021 by 4am
|
||||
;
|
||||
!cpu 6502
|
||||
;!to "build/FX.INDEXED/SHR.SNOWFLAKE",plain
|
||||
*=$A000
|
||||
|
||||
!source "src/fx/fx.shr.precomputed.a"
|
||||
|
||||
CoordinatesFile
|
||||
!byte 17
|
||||
!text "FX/SHR.FLAKE.DATA"
|
4003
src/fx/fx.shr.snowflake.data.a
Normal file
4003
src/fx/fx.shr.snowflake.data.a
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user