Skip to content

Muppetsg2/png-to-icns-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNG to ICNS (Python Version)

cover_png_to_icns

A Python script to convert your PNG images into Mac OS specific type ICNS (iconset) files — on any platform!

⚠️ This script is a Python implementation based on the original project by BenSouchet/png-to-icns. Adapted to work cross-platform, including on Windows.

Image Requirements

  • Format should be PNG (transparency isn't mandatory).
  • Dimensions need to be 1024x1024 pixels. (required for optimal quality on all macOS icon sizes)

Image Recommendations

  • A transparent background will be removed (as with the cat icon above)
  • Icons with a background generally do no fill the entire 1024x1024 space. They are usually inset by about 50px on each side. The rounded-rect-inset.png file in this repo provides a template that matches the style of many other icons: it's a white rounded-rectangle with a transparent border. Center your icon within the template, then use the procedure below.

How to Use

  1. Let’s get started by downloading the project, and move into the newly created folder:

    > git clone https://github.com/Muppetsg2/png-to-icns-py.git
    Cloning into 'png-to-icns-py'...
    
    > cd png-to-icns-py

    Or copy/paste the script file png_to_icns.py in a directory

  2. Optionally: Place the 1024x1024 pixels image (.png) you want to convert in the folder

  3. Install dependencies if needed:

    > pip install icnsutil pillow
  4. Start the script and give the path to the image with -i image_path

    > python ./png_to_icns.py -i <path_to_my_image.png>
    INFO: The icon has been successfully created: ./icon.icns
  5. Done! The new icon has been created, the path of this .icns is indicate on the info message in your terminal.

Errors / Bugs

If an error occurs, a message with the error(s) info will appear in the terminal. If you cannot see or understand the error, open an issue.

Author & Maintainer

This version is maintained by Muppetsg2.
Original concept by BenSouchet/png-to-icns.

The code present in this repository is under MIT license.

About

Python script to convert a PNG image to a Mac OS icon (ICNS iconset)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages