Skip to content

Commit

Permalink
oxipng instead
Browse files Browse the repository at this point in the history
  • Loading branch information
PoomSmart committed Jan 28, 2023
1 parent 46d9f57 commit 85a1aba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Python and shell scripts to backport and theme [Apple Color Emoji font](https://
- [Pillow](https://pillow.readthedocs.io/en/stable/) (`pip3 install --upgrade Pillow`)
- [afdko](https://github.com/adobe-type-tools/afdko) (`pip3 install afdko`)
- [pngquant](https://pngquant.org) (`brew install pngquant`)
- [zopfli](https://github.com/google/zopfli) (`brew install zopfli`)
- [oxipng](https://github.com/shssoichiro/oxipng) (`brew install oxipng`)

# Prerequisites (Theming)

Expand Down Expand Up @@ -43,7 +43,7 @@ EmojiFonts deals with certain font tables; mainly `GDEF` and `sbix`.
`extractor.py` extracts PNG emoji images from the font. This opens up the possibility to theme the emoji font.

# PNG Optimization
`pngquant` and `zopfli` are used to optimize the images with little to none changes to the quality. The Apple emoji font sizes are reduced by nearly 50% using this method. The simpler the emoji images, the more size reduction is achieved.
`pngquant` and `oxipng` are used to optimize the images with little to none changes to the quality. The Apple emoji font sizes are reduced by nearly 50% using this method. The simpler the emoji images, the more size reduction is achieved.

# Theming

Expand Down
14 changes: 7 additions & 7 deletions apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ then
fi

echo "Optimizing PNGs using pngquant..."
pngquant $COLORS -f --ext .png $ASSETS/160/*.png &
[[ $MOD == 'HD' ]] && pngquant -f --ext .png $ASSETS/160/*.png &
pngquant $COLORS -f --ext .png $ASSETS/96/*.png &
pngquant $COLORS -f --ext .png $ASSETS/64/*.png &
pngquant $COLORS -f --ext .png $ASSETS/40/*.png &
wait

# echo "Optimizing PNGs using zopflipng (slow)..."
# zopflipng --prefix $ASSETS/160/*.png &> /dev/null
# zopflipng --prefix $ASSETS/96/*.png &> /dev/null
# zopflipng --prefix $ASSETS/64/*.png &> /dev/null
# zopflipng --prefix $ASSETS/40/*.png &> /dev/null
# rename -f 's/(zopfli_)(.*)\.png/$2\.png/' $ASSETS/*/*.png
echo "Optimizing PNGs using oxipng..."
[[ $MOD == 'HD' ]] && oxipng -q $ASSETS/160/*.png &
oxipng -q $ASSETS/96/*.png &
oxipng -q $ASSETS/64/*.png &
oxipng -q $ASSETS/40/*.png &
wait

if [[ $MOD != '' ]]
then
Expand Down

0 comments on commit 85a1aba

Please sign in to comment.