Search the Community: Showing results for tags 'PNG'.
Found 2 results
For web work and in this case, boot manager imagery, 24-bit PNG files don’t have to be used and in most cases the same result can be achieved from an 8-bit PNG. Though be aware that some images, for example ones using fine gradients, can suffer from this process so you should check the results before your final use. 8-bit files are smaller than 24-bit files. Enter: pngquant If you just wish to simply compress a directory of .PNG files, run the following command to create new compressed versions of the files in the same directory whilst retaining the original files. pngquant 256 *.png There are other options available. Check pngquant’s help page for more info. How does this refer to Clover? Once upon a time, Clover’s theme files were uncompressed 24-bit PNG files saved inside an ICNS file. Clover would read each .ICNS file, extract the required size of .PNG and draw that icon to screen. Clover’s repository contained a number of themes and all these 24-bit PNG files and ICNS files resulted in the theme files making up a large percentage of the overall repository size. After discussion with Slice, Clover was then changed to be able to directly load individual PNG files rather then extract them from an ICNS file, though traditional .ICNS files can still be used. To convert all the existing themes, I created a simple bash script to scan and compress all the Clover theme directories. This script was hosted on projectosx but since that’s no longer available I am adding it here for legacy purposes. It’s uses a two step process: 1 - Find and compress all .PNG files. 2 - Find all .ICNS files, extract and compress each 128x128 .PNG image saving back with .ICNS extension to satifsy Clover. -r option can be used to rebuild ICNS files after image optimisation. Updated to v1.6 of the script which uses v2.5.2 of pngquant. optimiseTheme_v1.6.zip Usage is: (v1.5 upwards has an option to rebuild icons files after optimisation with additional -r at the end) ./optimiseTheme.sh /path/to/directory_of_images -r Note: The script overwrites the files it finds with the optimised versions. If you wish to retain the original files then keep those separate. This script could be improved but I never bothered as it did what I needed back then. If anybody does improve it then please post it back here. Conclusion All existing Clover themes that are in the Clover Theme Repository are now compressed (at least I think they are), so this script is not really needed any more. But, if you create a new theme using the old way of doing it (with .ICNS files), or if you do have a copy of an old theme that you want to compress then this script will still help. As far as 'optimised' .PNG files go though, you should always use them for whatever work you do as smaller files load quicker and take less space.
Here’s a script I wrote last year for creating font image files for both Chameleon’s and Clover’s GUI. Notes - Clover works best with monospaced fonts, where as Chameleon can use both monospaced and proportionally spaced fonts. - Both monospaced and proportional fonts can be used (for Clover, r3216 and up is required). - While this script does it’s stuff mathematically, sometimes the best results (optically) may only be achieved when making/adjusting the font files manually. Requirements ImageMagick Installing can be done using homebrew Once Homebrew is installed, you can run the following command from the Terminal: brew install imagemagick * Note: There are other ways to install ImageMagick but I've found only Homebrew does it simply with all required delegates. If you choose to install ImageMagick using other means (package installers, compile from source) then YMMV. createFont script Usage: ./createFont.sh -f[path/to/font] -s[size] <options> Help can be displayed using -h option: ./createFont.sh -h Please supply a minimum of the font and size. In this case a PNG image will be generated with the text in white on a transparent background. Options are: -a Alpha transparency for text. Value 0 thru 1 * Some versions of ImageMagick fail to render text with this option turned on. -b Background Colour. As three comma separated values Red, Green and Blue. [0-255],[0-255],[0-255] Note: background defaults to transparent. -c Colour of text. As three comma separated values Red, Green and Blue. [0-255],[0-255],[0-255] Note: text colour defaults to white. Some colour examples: Red: 205,0,0 Dark Blue: 35,43,148 Light Blue: 93,192,244 Bright Green: 91,226,81 Dark Green: 24,135,16 Bright Yellow: 219,221,47 -e Effects ---------------------------------------------------- shading Enable single colour shading effect. shadow Enable drop shadow effect (type 1 fonts only). -f Font. Either installed font name OR full file path. -h Display help. -i List installed fonts available to ImageMagick. -l Leading (Space between text lines) +/-16 (type 2) -r Reduced Character Set (Type 2 only) ---------------------------------------------------- a Do not include ANSI characters (32-127) c Do not include cyrillic characters. -s Size in pixels. Expects value between 6 and 255 -t Type ---------------------------------------------------- 1 Font type for Chameleon (Default). 2 Font type for Clover. -o Disable optimisation of final image using pngquant. -p Padding in pixels. Space between characters (type 1) -v Display version of this script. -x Disable anti aliasing. The script is not perfect and ImageMagick can do way more so if desired, feel free to improve the script but please post any updates here. Examples For a Chameleon (type 1) font: ./createFont.sh -t1 s14 -f/Users/blackosx/Library/Fonts/mplus-1c-black.ttf -b 100,150,24 Made this image: For a Clover (type 2) font: ./createFont.sh -t2 -s14 -f/Users/blackosx/Library/Fonts/mplus-1c-black.ttf -b 100,150,24 Made this image Note regarding sizes - Keep font sizes sensible as too large will be unusable. Here are two images, one using 28pt and the other using 16pt . Both of these are too large for ideal use. Note: These are using a Clover revision before 3216 where proportional spacing is not working properly. I will update these images soon. Update: to v0.87 - Added extra glyphs for radio buttons and checkboxes as per slice's request. (Note: Requires font containing those glyphs). - Included the use of imagemagik's X Constant Image option to help overcome Sherlock's issue. Update: to v0.88 - Apply X Constant Image option fix for type 2 fonts, to type 1 fonts. (Thanks for the note cecekpawon. I Finally got to it ). createFont_v0.88.zip