In chemistry lab, we made dyes by soaking fabric in one chemical, then in another, so the dye itself actually formed around the fibers instead of first creating the dye then dipping fabric in it to make the color. Because the dye is formed around the molecules of the fibers, it is very permanent.
The octopus was done by first soaking in one of the chemicals, then painting it on with the second. The rest is tie-dye.
This is actually the dye that is often used to make the red in the American flag.
Also, the dye looks like the blood from Sweeney Todd when it is in a flask.