Updated mockup rendering.

Every time you visit the Cotton Bureau home page or a product page or pretty much any page on the website, what you are actually looking at when you see a t-shirt is a carefully rendered mockup. The artwork (the design file you gave us) is layered over (and sometimes under) a series of other images to display a photorealistic composite that, we hope, matches what you and your customers ultimately receive in the mail after it has been printed.

When we started Cotton Bureau in 2013 (more about that next month!), that entire process took place in Photoshop. We took photos of blank shirts, then painstakingly separated the shapes, shadows, and highlights into separate layers. Every new shirt we added to the site was hand-edited to look great. It was also, as you can imagine, quite slow. As we added more shirt styles, the time to set up each new product naturally increased. We built tools; we automated; we eventually made the entire procedure self-serve — which is what you see when you go to submit a new product today.

Even at the small scale that Cotton Bureau operates at, you are still talking about hundreds of thousands of images today and likely millions of images in the near future. Each product typically has several colors, materials, and styles. Those images also then need to be served at device-appropriate resolutions. Altogether, that’s a lot of files, each of which are generated at the time of product creation then stored on servers all over the world to be displayed as quickly as possible when they are requested.

Clearly we’ve outgrown a few people on laptops cranking out mockups in Photoshop. What we have also outgrown thanks to the cost of storing and fetching all those images on all those servers is pre-generating every single needed file at the time of product creation that might ever be needed. With phone cases joining shirts last year (and hats and other new products on their way), we couldn’t wait any longer to create a new system.

The central premise of Cotton Bureau in 2013 is still the same today: try not to make something before you need it. That applies to images just as much as it applies to t-shirts. The cost of making and storing images is a lot lower than making and storing t-shirts, but the scale is a lot greater. What if we generated images just in time instead of (in computer terms) way, way ahead of time? If we did that, we could reduce the number of images we are storing (caching) from 100% to 10% or 1% or… 0.1%?

There’s no free lunch, of course. Now we’ll be paying more to generate images and less to store them, but overall we expect to see significant savings by migrating images away from Amazon and Imgix to our main servers (Linode).

Will you notice any of this? We hope not. We’ll be moving to the new system in stages over the next few months. If all goes according to plan, the website will look and feel the same.

But. All of that is relatively uninteresting and technical. Are there any other benefits? Yes! Because product images were all pre-rendered, changing any of the underlying assets meant massive re-renders across all site products. Adding colors and styles was quite painful. There is a plan — exacting timing is still very much tbd, though we are targeting 2023 —to start introducing additional non-core brands and styles (and completely new product types) as we are able to source and validate. That should result in increased flexibility for everyone in finding just the right garments.