Take me to the shirt generator
I've got a shirt with a fantastic polka-dot-like design on it. I bought it, knowing it wasn't quite the right fit, but I did it anyway. Over time, I realised my mistake but wanted to know if I could buy the fabric and have it custom made. The fabric was nowhere to be found, so looked into getting it made. When I discovered there are plenty of manufacturers / services out there that do small runs, I started to consider going a step further, what if I made my own patterns? After all, I had spent some time messing around with generatively coding out patterns for fun, maybe I could make my designs tangible?
Thing is, fabrication plus tailoring is probably going to cost, so I better do something nice. It was around this time I came across the USDA Pomological Watercolor Collection via the Old Fruit Pictures bot on twitter, or maybe the article about the collection on OpenCulture (a fantastic site, btw).
Either way, I've always appreciated botanical illustration, and fancied having a few prints in my flat. It's a small place, and there isn't that much room to hang stuff up without it feeling cluttered. But hey, what if I used some of the images in my own shirt design? Magic. But there are over 7000 paintings! It'd be tough but doable to hand sort and decide on a design. The images are openly licenced, the dataset is easy to work with, thanks to a consistent ID system, so instead, I decided to take a shot at generating patterns algorithmically by selecting and arranging images.
Anyway, hope you enjoy x - @digitalWestie
Take me to the shirt generator
Wrote a scraper for images and basic data, turns out there's a lot so I wrote a script to download every nth image
It turned out there's plenty of pictures showing rotten fruit and diseases. This is an intentional part of the archive, but not on my shirt thanks! I'll have to manually delete those ones I'm not so keen on.
Discovered a number of issues with the dataset, some fruit e.g. apples are way overrepresented and have duplicates. Apples are a bit boring in my book, also, I'm not that keen on them, being more into pears myself. It also has to be said peaches, lemons, and exotic fruits are just a bit more interesting to look at...
The archive is mostly just the fruits and ignores the leaves. It'd be nice to mix-up colours and some green in there too. If I had a stupid amount of time I'd extract histogram data from the images and define a script based on range of colours.
Rather late in the day I've realised a pattern projected on a shirt as if by projector throwing light on a wall isn't how it's going to look once a shirt is tailored from a flat pattern. Tailors work from pattern cutting diagrams where bodice arms etc. are cut separately. I'm sure there's software out there that projects these cuts and how they will look as a flat textile and as a finished garment.
Added a drag function to the textile so you can tweak the view. Along the way I learnt you can prevent click/drag events from being captured on elements by using CSS ie pointer-events: none;
, bit weird as it feels like a behaviourial thing!
Added a repetition range selector to control whether tiles repeate and how much. Max repeat is 9, anything over and it's randomised. Seems like there's still a lot of mouldy fruit.
Need some sort of save/export button, not sure how to achieve this, a simple screenshot? HTML? Image + text file? 'html2screenshot' library might help.
Added a capture with html2canvas, it clips the right side for some reason when the zoom level is at a certain scale. Annoying but I can't figure out how to fix.
Hit up a few tailors on peopleperhour, it's getting real now, I need to generate loads of options and go with a design
For further dev: add a slider to control opacity of images, sometimes they are a bit too strong
Got a fair few favourites now I'm more familiar with dataset, perhaps some sort of shortlisting feature?
Added a 'favourites' feature to help randomise among a select grouping
Finally decided on a pattern to use!
The shirt printing website required configuration so produced a high-res tile image
Discovered that my pattern is unidirectional! This means I need to get another metre printed
Finally ordered it!
I am super pleased. The detail is fantastic!