Intern @AKA | Part 3 Software Engineering @UoA
Python script using OpenCV to extract emojis from PNG sheets, handling inconsistent sizing and alignment through image detection.
The Python script extracts emojis from misaligned sprite sheets and removes backgrounds. It handles different sheet sizes and alignment through image detection rather than manual cropping, which provides a practical solution for batch-processing irregular image sources.
I wanted to extract and process cute emojis from sprite sheets found on Pinterest to add them to my Notion workspace. Given the volume of emojis required, manual extraction would have been impractical.
All sprite sheets had different numbers of rows and columns with irregular spacing and alignment, so it was difficult to crop at the right place. Initially, I named the sheets `colourtheme_rows_cols` to calculate approximate dimensions of each emoji, which only worked on some sheets. The background removal also did not work well on lighter colours, so I switched to OpenCV to detect image edges, which made the script work for any emoji colour and layout.