doc.go (1440B)
1 // Package icns implements an encoder for Apple's `.icns` file format. 2 // Reference: "https://en.wikipedia.org/wiki/Apple_Icon_Image_format". 3 // 4 // icns files allow for high resolution icons to make your apps look sexy. 5 // The most common ways to generate icns files are 1. use `iconutil` which is 6 // a Mac native cli utility, or 2. use tools that wrap `ImageMagick` which adds 7 // a large dependency to your project for such a simple use case. 8 // 9 // With this library you can use pure Go to create icns files from any source 10 // image, given that you can decode it into an `image.Image`, without any 11 // heavyweight dependencies or subprocessing required. You can also use this 12 // library to create icns files on windows and linux. 13 // 14 // A small CLI app `icnsify` is provided to allow you to create icns files 15 // using this library from the command line. It supports piping, which is 16 // something `iconutil` does not do, making it substantially easier to wrap. 17 // 18 // Encode resizes one image into every size. EncodeSlots takes a drawing per 19 // slot, as an iconset directory holds, and resizes only the slots left empty. 20 // NewDecoder reads the other way, identifying the icons in a file so that a 21 // caller can decode only the size it wants. 22 // 23 // Note: icns files are written with an icon at every size macOS draws, the 24 // retina OSTypes for the larger ones and the colour and mask pair Apple still 25 // uses at 16 and 32 pixels. 26 package icns