Stretching an image along a path


I would like to take a picture and mold it in the shape of a 2D heart.

Here is an example picture:

I hope to accomplish a heart shape using this picture and have the blues ends meet at the bottom tip of the heart.


Because everyone seems to be so stuck on my idea behind what I am doing with barcodes and not focusing on the question at hand, I decided to remove everything related to barcodes from the question and instead just used a stock picture that I would like to stretch across a path.

8/13/2012 9:45:00 PM

The question originally requested a way to distort a picture of a barcode along a path. This answer was an answer to that question - but may not be as applicable since the question has changed.

I recommend doing more research into how barcodes work before you attempt to incorporate them in a design1. There are over 40 bar code systems in active use. Each has its own "start and stop" requirements. Not all have terminal characters, some have other encodings and checkdigits. If you understand the system you are working with, and it is compatible with the font you select, there is nothing wrong with using fonts you find online.

One such system that works fine with fonts is a variable-length system called "Code 3 of 9" (or "Code 39"). The following image was generated with Code 39 from DaFont, and it happily decodes with the link you provided:


All that aside, I can tell you that what you are trying to do simply will not work. Once you plot your barcode along a path, it will become distorted. To "straighten out the path" and get a readable code, you'd have a complicated process requiring you to determine a centerline, plot the widths at the centerline, and reconstruct lines based on those widths. While that sounds theoretically possible, what are the odds someone will actually do that - and do it precisely enough that they can read your code?

1 - From a purely aesthetic viewpoint, fake barcodes can be just as stylish as real barcodes. The difficulty is incorporating usable barcodes.

8/13/2012 11:05:00 PM