Printing a GBCamImage
Thanks to Raphael BOICHOT who works on a Game Boy Printer Paper Simulation, here’s an example of how looks a printed image
1"""An example to use the thermal printer effect on an image."""
2
3import cv2
4
5import gamebeye.gbcamimage.gbcamfilters as gbcamfilters
6from gamebeye.gbcamimage.gbcamimage import GBCamImage
7
8# Path to the image
9image_filepath = "images\\originalImage.png"
10img = cv2.imread(image_filepath)
11
12# Creation of an GCCamImage object
13gb_img = GBCamImage()
14# Reading of the file
15gb_img.read(image_filepath)
16
17# Displaying the original image
18original_title = "Original image with {} color palette".format(
19 gb_img.color_palette.name
20)
21cv2.imshow(original_title, gb_img.data)
22print("Original color palette : {}".format(gb_img.color_palette))
23
24printed_image = gbcamfilters.to_thermal_printer(gb_img)
25printed_title = "Printed image"
26cv2.imshow(printed_title, printed_image)
27
28
29cv2.waitKey()
30cv2.destroyWindow(original_title)
31cv2.destroyWindow(printed_title)
So from this input :

Original Game Boy Camera Image
The output image is the following one :

Printed Game Boy Camera Image