Skip to content

Instantly share code, notes, and snippets.

@BDadmehr0
Created December 11, 2024 16:54
Show Gist options
  • Select an option

  • Save BDadmehr0/7bbddd540f4a86ee3668f0eb20406cc1 to your computer and use it in GitHub Desktop.

Select an option

Save BDadmehr0/7bbddd540f4a86ee3668f0eb20406cc1 to your computer and use it in GitHub Desktop.
To delete the ICC profile (color profile) of an image on a Linux system, you can use the **ImageMagick** tool. ImageMagick is a versatile tool for editing and converting images via the command line.
Here are the steps:
---
### **1. Install ImageMagick**
If not already installed, you can install ImageMagick using your package manager:
```bash
sudo apt update && sudo apt install imagemagick # For Ubuntu/Debian
sudo dnf install imagemagick # For Fedora
sudo pacman -S imagemagick # For Arch Linux
```
---
### **2. Check for ICC Profile**
To check if an image has an ICC profile:
```bash
identify -verbose image.jpg | grep "Profile-icc"
```
If an ICC profile exists, you’ll see details about it.
---
### **3. Remove the ICC Profile**
To remove the ICC profile, use the `mogrify` command:
```bash
mogrify +profile icc image.jpg
```
- **`+profile icc`**: Removes the ICC profile from the image.
- **`mogrify`**: Modifies the image in place (overwrites the original).
- Replace `image.jpg` with your file name.
If you want to preserve the original file, use the `convert` command instead:
```bash
convert image.jpg +profile icc image_no_icc.jpg
```
This will save the output as `image_no_icc.jpg`.
---
### **4. Verify Removal**
Run the following command again to ensure the ICC profile is gone:
```bash
identify -verbose image.jpg | grep "Profile-icc"
```
If no ICC profile is listed, it has been successfully removed.
---
Let me know if you encounter any issues!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment