elrumo / macOS_Big_Sur_icons_replacements

Replacement icons for popular apps in the style of macOS Big Sur
https://macosicons.com
GNU General Public License v3.0
4.18k stars 231 forks source link

Color profiles (like P3) aren't preserved when icons are uploaded. #1412

Open YousufSSyed opened 2 years ago

YousufSSyed commented 2 years ago

You might not think it, but there is a big difference in colors when preserving color profiles like P3. I created an image with a P3 color profile and uploaded it to the website, but when I downloaded it the color profile was gone. on a Mac, if you look at the PNG and ICNS (downloaded from the website) in the preview app and in two different tabs (which you would enable by going to View > Show Tab Bar), you can clearly see the color difference.

Icon ICNS Zip Icon PNG

I don't know how the website converts PNGs to ICNS files, but I have this shell script (but I forgot where I got it from!):

#!/bin/bash
IFS='.' read -ra ADDR <<< "$1"
ICONSET=${ADDR[0]}.iconset
mkdir $ICONSET
sips -z 16 16     $1 --out $ICONSET/icon_16x16.png
sips -z 32 32     $1 --out $ICONSET/icon_16x16@2x.png
sips -z 32 32     $1 --out $ICONSET/icon_32x32.png
sips -z 64 64     $1 --out $ICONSET/icon_32x32@2x.png
sips -z 128 128   $1 --out $ICONSET/icon_128x128.png
sips -z 256 256   $1 --out $ICONSET/icon_128x128@2x.png
sips -z 256 256   $1 --out $ICONSET/icon_256x256.png
sips -z 512 512   $1 --out $ICONSET/icon_256x256@2x.png
sips -z 512 512   $1 --out $ICONSET/icon_512x512.png
cp $1 $ICONSET/icon_512x512@2x.png
iconutil -c icns $ICONSET
rm -R $ICONSET

I save it as createicns.sh in a PATH directory, and in terminal would run createicns.sh 193595679-5433211a-74cc-4f80-a378-dcfe9605c567.png to convert it to ICNS without removing color profiles.