Jump to content

OpenCanopy Icons


blackosx
1,617 posts in this topic

Recommended Posts

Not to confuse, but here are the imageoptim-cli options

https://github.com/JamieMason/ImageOptim-CLI#-installation

 

Look like usage would be <imageoptim -a --imagealpha --quality 90> (or whatever we want it to be)

 

We have two options which we are developing at the same time, using imageoptim and/or pngquant. :drool:

Edited by pkdesign
Link to comment
Share on other sites

7 minutes ago, pkdesign said:

Not to confuse, but here are the imageoptim-cli options

https://github.com/JamieMason/ImageOptim-CLI#-installation

 

Look like usage would be <imageoptim -a --imagealpha --quality 90> (or whatever we want it to be)

 

We have two options which we are developing at the same time, using imageoptim and/or pngquant. :drool:

OK the best is  the command pngquant :thumbsup_anim: I test and verry fast and good :wink_anim:

Update 10 Sep 2020 Add Release V4 Update 10 Sep 2020 Add pngquant

 

Test and let me know :angel:

Edited by chris1111
  • Like 2
Link to comment
Share on other sites

Just one last thing and I think it will be perfect. B)

 

You have to move the pngquant command after the sips command. Right now the smaller versions are not getting compressed.

#!/bin/bash
# Simple bash script for icnspack by chris1111
PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"

rm -rf ./Resource
Sleep 1

cp -r ./Icon/Selector.png ./Icon/Selector40.png
cp -r ./Icon/Selected.png ./Icon/Selected144.png 
cp -r ./Icon/ExtHardDrive.png ./Icon/ExtHardDrive128.png
cp -r ./Icon/AppleRecv.png ./Icon/AppleRecv128.png
cp -r ./Icon/ExtAppleRecv.png ./Icon/ExtAppleRecv128.png
cp -r ./Icon/HardDrive.png ./Icon/HardDrive128.png
cp -r ./Icon/Apple.png ./Icon/Apple128.png
cp -r ./Icon/AppleTM.png ./Icon/AppleTM128.png 
cp -r ./Icon/Windows.png ./Icon/Windows128.png
cp -r ./Icon/Tool.png ./Icon/Tool128.png 
cp -r ./Icon/Shell.png ./Icon/Shell128.png
cp -r ./Icon/ResetNVRAM.png ./Icon/ResetNVRAM128.png
Sleep 1

sips -Z 40 ./Icon/Selector40.png
sips -Z 144 ./Icon/Selected144.png
sips -Z 128 ./Icon/ExtHardDrive128.png
sips -Z 128 ./Icon/AppleRecv128.png
sips -Z 128 ./Icon/ExtAppleRecv128.png
sips -Z 128 ./Icon/HardDrive128.png
sips -Z 128 ./Icon/Apple128.png
sips -Z 128 ./Icon/AppleTM128.png
sips -Z 128 ./Icon/Windows128.png
sips -Z 128 ./Icon/Tool128.png
sips -Z 128 ./Icon/Shell128.png
sips -Z 128 ./Icon/ResetNVRAM128.png
Sleep 1

./pngquant --quality=90 --ext=.png --force ./Icon/*.png 
Sleep 1

mkdir -p ./Resource
./icnspack ./Resource/Selector.icns ./Icon/Selector.png ./Icon/Selector40.png
./icnspack ./Resource/Selected.icns ./Icon/Selected.png ./Icon/Selected144.png
./icnspack ./Resource/ExtHardDrive.icns ./Icon/ExtHardDrive.png ./Icon/ExtHardDrive128.png
./icnspack ./Resource/AppleRecv.icns ./Icon/AppleRecv.png ./Icon/AppleRecv128.png
./icnspack ./Resource/ExtAppleRecv.icns ./Icon/ExtAppleRecv.png ./Icon/ExtAppleRecv281.png
./icnspack ./Resource/HardDrive.icns ./Icon/HardDrive.png ./Icon/HardDrive128.png
./icnspack ./Resource/Apple.icns ./Icon/Apple.png ./Icon/Apple128.png
./icnspack ./Resource/AppleTM.icns ./Icon/AppleTM.png ./Icon/AppleTM128.png
./icnspack ./Resource/Windows.icns ./Icon/Windows.png ./Icon/Windows128.png
./icnspack ./Resource/Tool.icns ./Icon/Tool.png ./Icon/Tool128.png
./icnspack ./Resource/Shell.icns ./Icon/Shell.png ./Icon/Shell128.png
./icnspack ./Resource/ResetNVRAM.icns ./Icon/ResetNVRAM.png ./Icon/ResetNVRAM128.png

Again, I changed the names of the pngs to reflect what size they are.

Edited by pkdesign
Link to comment
Share on other sites

2 minutes ago, pkdesign said:

Just one last thing and I think it will be perfect. B)

 

You have to move the pngquant command after the sips command. Right now the smaller versions are not getting compressed.

If the smaller is not compress  it doesn't anymore with manual script

 

My image looks verry good compare to ImageOptim I have Apple.png at 19kb with pngquant :D

Link to comment
Share on other sites

I finally got imageoptim to work and you are right, it is very slow. And you would have to have it installed. Of course most of us would have that installed. :rolleyes:

 

/Applications/ImageOptim.app/Contents/MacOS/ImageOptim ./Icon/*.png

 

The pngquant command is way faster.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, pkdesign said:

I finally got imageoptim to work and you are right, it is very slow. And you would have to have it installed. Of course most of us would have that installed. :rolleyes:

 

/Applications/ImageOptim.app/Contents/MacOS/ImageOptim ./Icon/*.png

 

The pngquant command is way faster.

Ok I have correct the script :D thank you for the catch 

 

Yea its slow I told you I have test ImageOptim on all the way that's why I change for pngquant :plane:

Edited by chris1111
  • Like 1
Link to comment
Share on other sites

Well done guys for adding compression. So maybe my thoughts weren't so bad after all? ;)

 

13 hours ago, pkdesign said:

This also means that all my ICNS can be made smaller. I'm kind of tickled that we are worrying about a few KB! These days when file size are huge.

Vit mentions the reason here at Applelife

To quote:

Quote

Plus, the size is quite critical there, since FAT drivers (and often block devices) are often slow, so we run everything through ImageOptim in order to reduce I / O as much as possible.

 

Edited by blackosx
  • Like 1
Link to comment
Share on other sites

8 hours ago, blackosx said:

Well done guys for adding compression. So maybe my thoughts weren't so bad after all? ;)

 

Your thoughts are not bad, have you taken the time to rename the script and adapt it to your icons? because I don't know if you know it but the application can make an icon as it can make a hundred so it would be good because I could add it and make it compatible with your work. Moreover with each addition of new icon the script would be modified and this while waiting to have a better solution which I have not found so far because the options of icnspack are limited. it's up to you to see thank you.

EDIT ***

All icons of my themes have just been compressed-2020 /11/ Sept :moil:

#!/bin/bash
# Simple bash script for icnspack by chris1111
PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"


Sleep 1

cp -r /Private/tmp/Icon/Selector.png /Private/tmp/Icon/Selector1.png
cp -r /Private/tmp/Icon/Selected.png /Private/tmp/Icon/Selected1.png 
cp -r /Private/tmp/Icon/ExtHardDrive.png /Private/tmp/Icon/ExtHardDrive1.png
cp -r /Private/tmp/Icon/AppleRecv.png /Private/tmp/Icon/AppleRecv1.png
cp -r /Private/tmp/Icon/ExtAppleRecv.png /Private/tmp/Icon/ExtAppleRecv1.png
cp -r /Private/tmp/Icon/Apple.png /Private/tmp/Icon/Apple1.png
cp -r /Private/tmp/Icon/HardDrive.png /Private/tmp/Icon/HardDrive1.png
cp -r /Private/tmp/Icon/AppleTM.png /Private/tmp/Icon/AppleTM1.png 
cp -r /Private/tmp/Icon/Windows.png /Private/tmp/Icon/Windows1.png
cp -r /Private/tmp/Icon/Tool.png /Private/tmp/Icon/Tool1.png 
cp -r /Private/tmp/Icon/Shell.png /Private/tmp/Icon/Shell1.png
Sleep 1
sips -Z 40 /Private/tmp/Icon/Selector.png
sips -Z 144 /Private/tmp/Icon/Selected.png
sips -Z 128 /Private/tmp/Icon/ExtHardDrive.png
sips -Z 128 /Private/tmp/Icon/Apple.png
sips -Z 128 /Private/tmp/Icon/AppleRecv.png
sips -Z 128 /Private/tmp/Icon/ExtAppleRecv.png
sips -Z 128 /Private/tmp/Icon/HardDrive.png
sips -Z 128 /Private/tmp/Icon/AppleTM.png
sips -Z 128 /Private/tmp/Icon/Windows.png
sips -Z 128 /Private/tmp/Icon/Tool.png
sips -Z 128 /Private/tmp/Icon/Shell.png
Sleep 1
./pngquant --quality=90 --ext=.png --force /Private/tmp/Icon/*.png
Sleep 2
./icnspack /Private/tmp/Resource/Selector.icns /Private/tmp/Icon/Selector.png /Private/tmp/Icon/Selector1.png
./icnspack /Private/tmp/Resource/Selected.icns /Private/tmp/Icon/Selected.png /Private/tmp/Icon/Selected1.png
./icnspack /Private/tmp/Resource/ExtHardDrive.icns /Private/tmp/Icon/ExtHardDrive.png /Private/tmp/Icon/ExtHardDrive1.png
./icnspack /Private/tmp/Resource/Apple.icns /Private/tmp/Icon/Apple.png /Private/tmp/Icon/Apple1.png
./icnspack /Private/tmp/Resource/AppleRecv.icns /Private/tmp/Icon/AppleRecv.png /Private/tmp/Icon/AppleRecv1.png
./icnspack /Private/tmp/Resource/ExtAppleRecv.icns /Private/tmp/Icon/ExtAppleRecv.png /Private/tmp/Icon/ExtAppleRecv1.png
./icnspack /Private/tmp/Resource/HardDrive.icns /Private/tmp/Icon/HardDrive.png /Private/tmp/Icon/HardDrive1.png
./icnspack /Private/tmp/Resource/AppleTM.icns /Private/tmp/Icon/AppleTM.png /Private/tmp/Icon/AppleTM1.png
./icnspack /Private/tmp/Resource/Windows.icns /Private/tmp/Icon/Windows.png /Private/tmp/Icon/Windows1.png
./icnspack /Private/tmp/Resource/Tool.icns /Private/tmp/Icon/Tool.png /Private/tmp/Icon/Tool1.png
./icnspack /Private/tmp/Resource/Shell.icns /Private/tmp/Icon/Shell.png /Private/tmp/Icon/Shell1.png



Sleep 1
cd /Private/tmp 
zip -r Resource.zip Resource
Sleep 1
rm -rf /tmp/Icon
rm -rf /tmp/Resource

 

Edited by chris1111
All icons of my themes have just been compressed-2020 /11/ Sept ​​​​​​​
  • Like 2
Link to comment
Share on other sites

Well done with optimising all your icons :)

 

How about this revised script?

#!/bin/bash

PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"

[[ ! -f icnspack ]] && echo "Error. Missing icnspack tool" && exit 1
[[ ! -f pngquant ]] && echo "Error. Missing pngquant tool" && exit 1

IN_DIR="$PARENTDIR"/IN
OUT_DIR="$PARENTDIR"/OUT

[[ ! -d "$IN_DIR" ]] && mkdir "$IN_DIR"
[[ ! -d "$OUT_DIR" ]] && mkdir "$OUT_DIR"

for pngFile in "$IN_DIR"/*.png
do

  filename=$(basename -- "$pngFile")
  filenameNoExt="${filename%*.png}"

  cp "$pngFile" "$OUT_DIR"

  width=$(sips -g pixelWidth "$pngFile")
  height=$(sips -g pixelHeight "$pngFile")

  width="${width##*: }"
  height="${height##*: }"

  halfWidth=$(( width/2 ))
  halfHeight=$(( height/2 ))

  sips --deleteProperty profile -Z $halfWidth $halfHeight "$pngFile" --out "$OUT_DIR"/"$filenameNoExt"_sml.png &>/dev/null

  ./pngquant --quality=90 --ext=.png --force "$OUT_DIR"/*.png

  ./icnspack "$OUT_DIR"/"$filenameNoExt".icns "$OUT_DIR"/"$filenameNoExt"_sml.png "$OUT_DIR"/"$filenameNoExt".png && echo "Generated $filenameNoExt.icns" && rm "$OUT_DIR"/*.png

done

icnspack-Builder_B.zip

 

Place all full size PNG files (drive, selected, selector, cursor) in the IN dir, double-click icnspack-Build.command and have all ICNS files in OUT dir. Resulting ICNS file will have the same name as the PNG file (apart from extension).

 

I've added some basic error checking, though it's not bullet proof. But it works fine here.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

51 minutes ago, blackosx said:

Well done with optimising all your icons :)

 

How about this revised script?


#!/bin/bash

PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"

[[ ! -f icnspack ]] && echo "Error. Missing icnspack tool" && exit 1
[[ ! -f pngquant ]] && echo "Error. Missing pngquant tool" && exit 1

IN_DIR="$PARENTDIR"/IN
OUT_DIR="$PARENTDIR"/OUT

[[ ! -d "$IN_DIR" ]] && mkdir "$IN_DIR"
[[ ! -d "$OUT_DIR" ]] && mkdir "$OUT_DIR"

for pngFile in "$IN_DIR"/*.png
do

  filename=$(basename -- "$pngFile")
  filenameNoExt="${filename%*.png}"

  cp "$pngFile" "$OUT_DIR"

  width=$(sips -g pixelWidth "$pngFile")
  height=$(sips -g pixelHeight "$pngFile")

  width="${width##*: }"
  height="${height##*: }"

  halfWidth=$(( width/2 ))
  halfHeight=$(( height/2 ))

  sips --deleteProperty profile -Z $halfWidth $halfHeight "$pngFile" --out "$OUT_DIR"/"$filenameNoExt"_sml.png &>/dev/null

  ./pngquant --quality=90 --ext=.png --force "$OUT_DIR"/*.png

  ./icnspack "$OUT_DIR"/"$filenameNoExt".icns "$OUT_DIR"/"$filenameNoExt"_sml.png "$OUT_DIR"/"$filenameNoExt".png && echo "Generated $filenameNoExt.icns" && rm "$OUT_DIR"/*.png

done

icnspack-Builder_B.zip

 

Place all full size PNG files (drive, selected, selector, cursor) in the IN dir, double-click icnspack-Build.command and have all ICNS files in OUT dir. Resulting ICNS file will have the same name as the PNG file (apart from extension).

 

I've added some basic error checking, though it's not bullet proof. But it works fine here.

 

Well Done:D I adapt with the app(Command)  and looks working good thank you very much ;)

 

I will release a V5 after more test 

#!/bin/bash
# Simple bash script for icnspack by chris1111
# Credit: OpenCore Team, blackosx, pkdesign, pngquant. 
PARENTDIR=$(dirname "$0")
cd "$PARENTDIR"


[[ ! -f icnspack ]] && echo "Error. Missing icnspack tool" && exit 1
[[ ! -f pngquant ]] && echo "Error. Missing pngquant tool" && exit 1

IN_DIR="/Private/tmp/Icon"
OUT_DIR="/Private/tmp/Resource"

[[ ! -d "$IN_DIR" ]] && mkdir -p "$IN_DIR"
[[ ! -d "$OUT_DIR" ]] && mkdir -p "$OUT_DIR"

for pngFile in "$IN_DIR"/*.png
do

  filename=$(basename -- "$pngFile")
  filenameNoExt="${filename%*.png}"

  cp "$pngFile" "$OUT_DIR"

  width=$(sips -g pixelWidth "$pngFile")
  height=$(sips -g pixelHeight "$pngFile")

  width="${width##*: }"
  height="${height##*: }"

  halfWidth=$(( width/2 ))
  halfHeight=$(( height/2 ))

  sips --deleteProperty profile -Z $halfWidth $halfHeight "$pngFile" --out "$OUT_DIR"/"$filenameNoExt"_sml.png &>/dev/null

  ./pngquant --quality=90 --ext=.png --force "$OUT_DIR"/*.png

  ./icnspack "$OUT_DIR"/"$filenameNoExt".icns "$OUT_DIR"/"$filenameNoExt"_sml.png "$OUT_DIR"/"$filenameNoExt".png && echo "Generated $filenameNoExt.icns" && rm "$OUT_DIR"/*.png



done



Sleep 1
cd /Private/tmp 
zip -r Resource.zip Resource
Sleep 1
rm -rf /tmp/Icon
rm -rf /tmp/Resource

 

  • Like 2
Link to comment
Share on other sites

Oooo! I can't wait to test this!

 

EDIT:

Just ran this script and it works fantastically. Somehow it made even smaller ICNS!

 

Threw PNGs that were randomly named and it created ICNS with the same name with no issue.

 

I think we mat have it!

Edited by pkdesign
Tested script
  • Like 2
Link to comment
Share on other sites

1 minute ago, pkdesign said:

You didn’t use the icon I created? Also there are some spelling and grammar errors in descriptor :rolleyes:

 

I edited if you want to use it.

 

 

 

 

TXT.rtf

Ok sorry I will change verry soon and the corrections txt file ;)

Link to comment
Share on other sites

×
×
  • Create New...