Visualize images with graphs
- Matplotlib -
pip install matplotlib
- Pillow -
pip install pillow
- Numpy -
pip install numpy
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.
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)
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)
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)
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)
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)
The 2D functions have the following parameters:
- image (str): The path to the image
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")
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")
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")
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")
The demo script is located in the demo.py file. This script will run all the functions with the example image.
This project is licenced under the GNU General Public License v3.0. See the LICENCE file for more information.