This project explores the intersection of sentiment analysis and generative art, utilizing computational tools to transform textual inputs into dynamic visual patterns that resemble fabric textures. By analyzing the emotional tone and word count of a given text using the AFINN sentiment analysis ( https://editor.p5js.org/codingtrain/sketches/aNeMdpy-b ), numerical scores are extracted and mapped to design parameters such as rectangle size, position, and texture.
The resulting visuals are composed of overlapping layers that respond to both the sentiment score and the word count, creating a unique balance of structure and randomness. Rectangles are scaled to reflect the emotional polarity of the text, with positive or negative values influencing their dimensions. Simultaneously, the number of words in the text introduces additional variability, affecting placement and size in less predictable ways. These layers are enhanced through dithering techniques like Floyd-Steinberg and Atkinson, which add intricate halftone textures that echo the appearance of woven or stitched fabric.
The project began by integrating sentiment analysis to drive the design of patterns. Two key variables were extracted from the analyzed text:
- Sentiment Analysis Score: Determined the pattern for one part of the piece.
- Word Count: Controlled the design of the second part, ensuring variability across outcomes.
Initially, the code used two static images as base patterns. The dither intensity of these images was manipulated to introduce variability. However, this approach was limited, as the patterns lacked sufficient diversity due to reliance on the same underlying images. To address this limitation, the static images were replaced with dynamically generated shapes—specifically rectangles—that responded directly to the extracted sentiment scores and word counts.
https://editor.p5js.org/Sebaabdullatif/sketches/N0N3s5Ol7