Remove alpha channel in an image

The accepted answer to export to JPG, then back to PNG is not recommended.

  • It's an extra step in the process (2 exports)
  • JPG is lossy, so you will lose some image data

Here's a super fast and easy way to do this without the extra export or saving to (lossy) JPG:

Using Preview app (Mac):

  1. Open the image
  2. Command-Shift-S to Duplicate (creates a copy)
  3. Command-S to Save
  4. Deselect the "Alpha" checkbox
  5. Delete " copy" from filename (including the space)
    • This will overwrite your original, if you want to keep the original, just leave "copy" in the name
  6. Save
  7. Click 'Replace' to confirm you want to overwrite the original
    • Only necessary if you are overwriting your original remove alpha channel

if you need remove all alpha channel from directory with icons use this command:

for i in `ls *.png`; do convert $i -background black -alpha remove -alpha off $i; done

if you have Mac OS Mojave and had "convert command not found"

brew install imagemagick

To install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

Tags:

Ios

Image

Alpha