A photo constructor is a craft kit that helps you create a photo-based ‘pin art’ style picture by forming an image on a canvas using pins of various diameters. A pin is a thin metal rod, sharpened at one end and finished with a round head at the other. The kit can be used to create avatars, personalised gifts, and cards from cherished photographs for your loved ones.
“The idea arose to develop a new product that would allow you to create your own mosaic from a selected picture. The company EDISON prepared the necessary solution for us. We hope to continue our cooperation.”
The project objective was to build a web-based tool that visualises the craft and generates an assembly scheme from an input image. A preview image allows the user to see how the finished piece will look once assembled. The assembly scheme provides step-by-step instructions for building the mosaic.
Image pre-processing using auxiliary algorithms
When a user uploads an image to the photo constructor, the first step is to confirm that it is suitable for transformation. Standard checks include dimensions (width and height), shape (it must be square), file type, and file size. Extremely large files (for example, 1 GB) are not suitable for processing. If the image passes validation, it is resized to the standard 600×600 pixels, enabling consistent handling by the main algorithms.
Next, image pre-processing improves the quality of both the pin-art preview and the assembly scheme. Two pre-processing options are available:
- Adaptive image sharpening: sharpness is increased at edges and reduced towards the centre, implemented via PHP
Imagick::adaptiveSharpenImage. - Image histogram equalisation: brightness is equalised automatically using PHP
Imagick::equalizeImage.
Pre-processing tests showed improved preview and scheme quality when both options are applied. The following sections describe each enhancement algorithm in more detail.
Adaptive image sharpening
The adaptive sharpening algorithm improves clarity and fine detail while minimising noise and artefacts in smooth, low-detail regions. The goal is to increase sharpness only where it adds value, rather than sharpening the entire image uniformly. Key steps include: