Skip to content

The Color Code Extractor is a Python script designed to extract both RGB and HEX color codes from images. It provides a simple and efficient way to analyze images and retrieve the color information of the first pixel. The script utilizes the Python Imaging Library (PIL) to open and process images, ensuring compatibility with various image formats.

License

Notifications You must be signed in to change notification settings

Pasindu-Vishmika/image-color-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Image Color Extractor

This Python script extracts both RGB and HEX color codes from images. It supports popular image formats like PNG, JPEG, and more, providing flexibility to specify image paths for analysis. The script outputs color codes in both RGB and HEX formats, making it easy to integrate into other applications or workflows.

Key Features

  • Extracts RGB and HEX color codes from images.
  • Supports popular image formats like PNG, JPEG, and more.
  • Provides flexibility to specify image paths for analysis.
  • Outputs color codes in both RGB and HEX formats for easy integration into other applications or workflows.

How to Use

  1. Clone the repository to your local machine:

    git clone https://github.com/Pasindu-Vishmika/image-color-extractor.git
  2. Install the necessary dependencies, such as PIL (Python Imaging Library). You can install dependencies using pip:

    pip install pillow
  3. Add your image to img_location directory

  4. Update code line number 22 with your_image_name.extention .

    Usage Example

    image_name = "your_image_name.extention" -> image_name = "111.png"

  5. The script will process the image and output the RGB and HEX color codes of the first pixel.

Usage Example

python color_code_extractor.py 

About

The Color Code Extractor is a Python script designed to extract both RGB and HEX color codes from images. It provides a simple and efficient way to analyze images and retrieve the color information of the first pixel. The script utilizes the Python Imaging Library (PIL) to open and process images, ensuring compatibility with various image formats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages