Skip to content

0x4248/ImgVis

ImgVis

Visualize images with graphs

Requiered packages

  • Matplotlib - pip install matplotlib
  • Pillow - pip install pillow
  • Numpy - pip install numpy

3D Functions

Each function has the following parameters:

  • image (str): The path to the image.
  • compression (int): The compression of the image. This is the times that the image is compressed. The higher the compression, the faster the function will run, but the less accurate the graph will be. The default value is 0 which means that the image will not be compressed.

Colour 3D

Demo

Visualize the colour of the image in 3D space. The x-axis is the red channel, the y-axis is the green channel and the z-axis is the blue channel.

import ImgVis

ImgVis.colour_3d("example.png", compression=10)

Brightness 3D

Demo

Visualize the brightness of the image in 3D space. The x-axis is the red channel, the y-axis is the green channel and the z-axis is the blue channel.

import ImgVis

ImgVis.brightness_3d("example.png", compression=10)

Red 3D

Demo

Visualize the red channel of the image in 3D space. The x-axis is the red channel, the y-axis is the green channel and the z-axis is the blue channel.

import ImgVis

ImgVis.red_3d("example.png", compression=10)

Green 3D

Demo

Visualize the green channel of the image in 3D space. The x-axis is the red channel, the y-axis is the green channel and the z-axis is the blue channel.

import ImgVis

ImgVis.green_3d("example.png", compression=10)

Blue 3D

Demo

Visualize the blue channel of the image in 3D space. The x-axis is the red channel, the y-axis is the green channel and the z-axis is the blue channel.

import ImgVis

ImgVis.blue_3d("example.png", compression=10)

2D Functions

The 2D functions have the following parameters:

  • image (str): The path to the image

Red Line 2D

Demo

Visualize the red channel of the image in 2D space. The x-axis is the red channel and the y-axis is the green channel.

import ImgVis

ImgVis.red_line_2d("example.png")

Green Line 2D

Demo

Visualize the green channel of the image in 2D space. The x-axis is the red channel and the y-axis is the green channel.

import ImgVis

ImgVis.green_line_2d("example.png")

Blue Line 2D

Demo

Visualize the blue channel of the image in 2D space. The x-axis is the red channel and the y-axis is the green channel.

import ImgVis

ImgVis.blue_line_2d("example.png")

Combined Line 2D

Demo

Visualize the red, green and blue channel of the image in 2D space. The x-axis is the red channel and the y-axis is the green channel.

import ImgVis

ImgVis.combined_line_2d("example.png")

Demo script

The demo script is located in the demo.py file. This script will run all the functions with the example image.

Licence

This project is licenced under the GNU General Public License v3.0. See the LICENCE file for more information.