Is it possible to do a text name repeat based on variable length with one request?
One Font:
Two Font:
This is what we'd ultimately want to do. Repeating of a name, that's provided to us, either with one font or two fonts in a brick pattern.
Based on our research we're able to do this with Cloudinary if we first do an image upload (POST /image/text) with the input name and obtain the height and width as a result.
Then using the resulting height and width we'd construct a transformation request/url that overlays this text in a brick pattern like the two images above. (The background image would be a flat color that's also provided.)
With this approach it will be two requests. Since we'd need to know how big the text would look on the Cloudinary "canvas" before laying out the coordinates for each name in the pattern.
Our question is if this is possible to do this in just one request/transformation?
I'm still in the process of learning everything that Cloudinary provides, I could use all the help I could get!
Answers
-
Hi there,
It is possible to achieve this with a single URL, albeit a little bit long.
Below is the transformation breakdown:
To simplify what the above transformation is doing, it creates a layer as a canvas double the size of the original (for later purpose to fill the gap due to rotation), and inside that layer, we can apply the text overlay and tiled it. Tiling allows you to repeat the text within that bounding box. Once that's done, rotates that tile 45 degree angle. And re-crop to original image.
Let me know if there is any question on this.
Regards,
Tamara
0