This package provides functionality for image processing and generate a normal map texture.
The ImageIO
package is responsible for reading and saving images.
-
read_image(image_path: str) -> numpy.ndarray
: Reads an image from the specified path and returns it as a NumPy array. -
save_image(image: numpy.ndarray, path: str) -> None
: Saves an image to the specified path.
The ImageProcessing
package is responsible for image processing and generating a normal map.
generate_normal_map(image: numpy.ndarray) -> PIL.Image.Image
: Generates a normal map from an input image and returns it as a PIL Image object.
The imagePlot
package is responsible for displaying and saving images.
plot(image: numpy.ndarray) -> None
: Displays an image and saves it to the current directory.
Here's an example of how to use the Image Processing Package:
from ImageIO import ImageIO
from ImageProcessing import ImageProcessing
from imagePlot import Plot
# Read an image
image = ImageIO.read_image('path/to/image.jpg')
# Generate a normal map
normal_map = ImageProcessing.generate_normal_map(image)
# Save the normal map
ImageIO.save_image(normal_map, 'path/to/normal_map.png')
# Display and save the image
plotter = Plot()
plotter.plot(image)
The Image Processing Package has the following requirements:
numpy
opencv_python
Pillow
scikit-image
https://pypi.org/project/image-processing-package-dio-challenge/