Created
January 21, 2013 06:27
-
-
Save takuma7/4584000 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage markers = loadImage("AllBchThinMarkers.png"); | |
int w = 12, h = 12; | |
int w_m = 8, h_m = 8; | |
int r_num = 64; | |
int c_num = 64; | |
int id = 0; | |
for (int ky = 0; ky < c_num * h; ky += h) { | |
for (int kx = 0; kx < r_num * w; kx += w) { | |
PImage marker = createImage(w_m, h_m, RGB); | |
for (int y = ky + h - h_m, _y = 0; y < ky + h; y++, _y++) { | |
for (int x = kx + w - w_m, _x = 0; x < kx + w; x++, _x++) { | |
int pos = y*markers.width + x; | |
int _pos = _y*w_m + _x; | |
marker.pixels[_pos] = markers.pixels[pos]; | |
} | |
} | |
marker.save("AR_marker_" + nf(id, 4) + ".png"); | |
id++; | |
} | |
} | |
println("done!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment