Jump to content


Photo

ZigArt


  • Please log in to reply
14 replies to this topic

#1 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9488 posts
  • Version:GM:Studio

Posted 25 October 2011 - 03:37 AM

Posted Image

I was inspired by a piece of art my friend shared with me on Facebook. I don't know if there's an actual name for this style of art, but I call it ZigArt (as in, Zig-Zag). As inspired as I was, I have little artistic skill, but since the concept looked simple, I decided to program a quick app in GM to make these artistic images for me :P .

ZigArt is created using the following simple rules:

1) Every line starts from off the page.
2) Any lines in the background slope up-left, any lines in the foreground (i.e. part of the text) slope down-left.
3) When drawing a line, when you move from the background to the foreground, you turn into the foreground; when you move from the foreground to the background, you turn away from the foreground.

Those three simple rules create some pretty cool graphics; the logo above, the Loading image, and the icon were all created with this program.

Download: http://dl.dropbox.co...gArt/ZigArt.zip

When you start the program, you're asked for the text to draw, then you can choose a color. The background is always drawn with black lines, but you can have the text portions be drawn in a different color if you want.

Here's what an all-black ZigArt looks like (this is the style of the original image that inspired this program):

Posted Image

When you've chosen a color, you'll get to watch the entire process as the computer goes about its business generating your image line-by-line. If it looks like it's gotten stuck in a loop, don't worry; it's guaranteed never to get stuck longer than 3 seconds.

It's not perfect--there are situations in which it'll leave out a chunk of space in the middle--but if you stick to a one or two word limit, it should be great.

Let me know what you guys think!

-IMP

*EDIT* Oh, and I even threw in an Easter egg, if you want to look for it ;) .

Edited by IceMetalPunk, 25 October 2011 - 03:38 AM.

  • 0

#2 amiel

amiel

    GMC Member

  • GMC Member
  • 1122 posts
  • Version:Unknown

Posted 25 October 2011 - 04:06 AM

nice.You're a genius!
Posted Image
This application got a lot of future to come.
:whistle:
  • 0

#3 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9488 posts
  • Version:GM:Studio

Posted 25 October 2011 - 06:29 AM

Thanks :) .

And I forgot to mention this, but if you have words that can't be broken up, so you end up with a text wider than the screen, it will auto-scroll as the pencil moves off screen. If this is the case, then when it's complete, you can use the left/right arrow keys to manually scroll the finished image.

By the way, find that Easter egg yet? I'll give you a hint: it's somewhere over there.

-IMP

Edited by IceMetalPunk, 25 October 2011 - 06:30 AM.

  • 0

#4 AhmedElyamani

AhmedElyamani

    Yamani

  • GMC Member
  • 1898 posts
  • Version:GM:Studio

Posted 04 December 2011 - 08:27 AM

Hello, IMP
i really love this great program, you amazed me as usual ::lmao::
anyway, it'd be really cool if you give me the exact code , or at least a pseudo code , So i can write it in c# as a plugin for paint.net ..
Thanks very much!
  • 0

#5 Shadow Link

Shadow Link

    GMC Member

  • GMC Member
  • 1607 posts

Posted 05 December 2011 - 02:19 AM

I'll give you a hint: it's somewhere over


Aww, no fun. Got it instantly. I gotta say though, I think I prefer the black background.

Neat little tool you whipped up. It's always fun to mix art with programming. It kind of reminds me of those Lego robots that use pens to make spirograms, even down to the whole process of having to wait for the thing to be done, haha. Nice work :P
  • 0

#6 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9488 posts
  • Version:GM:Studio

Posted 05 December 2011 - 06:07 AM

@ahmed # elyamani: I could, but there's a reason it shows you the drawing process; it's too slow to have a run-once-and-done version. Well, maybe that's not true. GM is notoriously slow with graphics, so maybe a C# version would be faster? I guess I could PM you the .GMK if you really want? Just let me know.

@ShadowLink: It is fun, isn't it? :P . And thanks. I have to admit, I didn't make this to mix art with programming. I made it to make art for me because I'm not at all artistic :lol: .

-IMP
  • 0

#7 AhmedElyamani

AhmedElyamani

    Yamani

  • GMC Member
  • 1898 posts
  • Version:GM:Studio

Posted 05 December 2011 - 11:34 AM

Yeah , please send me The gml code or just a pseudo code , i can write them as c# and see if they will be good .. I may use them for other things than text actually ;)
Thanks :)

Ahmed
  • 0

#8 Big J

Big J

    GMC Member

  • GMC Member
  • 2852 posts
  • Version:GM8.1

Posted 15 December 2011 - 10:45 AM

This is awesome, although it's slow and CPU intensive. :tongue:
  • 0

#9 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9488 posts
  • Version:GM:Studio

Posted 16 December 2011 - 01:35 AM

This is awesome, although it's slow and CPU intensive. :tongue:

Well, it's drawing a full-scale image pixel-by-pixel, so it's slow, and the room_speed is cranked up to 999 for full-speed, so that explains the CPU usage. If you can figure out a faster way to implement that algorithm, be my guest :P .

Actually, I guess if you can calculate the turning points, you can just draw lines, and that would speed it up...maybe a binary search for that would be okay...but, meh, I'm not up for the effort :lol: .

-IMP
  • 0

#10 Big J

Big J

    GMC Member

  • GMC Member
  • 2852 posts
  • Version:GM8.1

Posted 16 December 2011 - 01:38 AM

Well, it's refreshing the screen after each pixel, right? That kind of slows it down, no? Then again, maybe it would kill my computer if it ran full speed.

I did notice a lot of redundant drawing, where the pencil would draw on the same pixels 5 times.

Edited by Big J, 16 December 2011 - 02:15 AM.

  • 0

#11 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9488 posts
  • Version:GM:Studio

Posted 16 December 2011 - 10:13 PM

Well, it's refreshing the screen after each pixel, right? That kind of slows it down, no? Then again, maybe it would kill my computer if it ran full speed.

I did notice a lot of redundant drawing, where the pencil would draw on the same pixels 5 times.

It's refreshing the screen because if it didn't, it would freeze up for at least a full minute with no indication of progress (or at the very least, a very slow progress bar), and no one would ever wait around for it to finish :lol: .

As for drawing the same pixels...yeah. Sometimes it gets caught in a loop, just from the algorithm itself (depending on the shape of the text). I couldn't figure out any way to detect that without a massive grid or something, so I just put a 3 second timeout on it, since no non-looping lines should ever take more than 3 seconds to draw.

I suppose I could just put in that massive grid, one cell for each pixel, and clear it to 0, adding 1 every time it's drawn on, and if it ever hits a cell with a value of more than 4 or 5, it moves on... I just don't really like the idea of such a large grid...

If I get any free time where I'm not working on Sophia's Spirits or studying for finals or preparing for vacation travels...then maybe I'll try it out :P .

-IMP
  • 0

#12 sasuke12

sasuke12

    GMC Member

  • GMC Member
  • 163 posts

Posted 21 February 2012 - 10:44 PM

Chuck e Cheese! That's where I saw this type of thing before! It took a picture of you and then drew out a sketch that you got to watch on a screen! You could always try to do that? There was a .dll that I recently saw, I don't recall the name, but it allowed you to take a snapshot with a connected webcam, so I assume if you were to use that .dll, take a picture when they clicked the button, and then drew it out for them, that would be a cool feature!
  • 0

#13 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9488 posts
  • Version:GM:Studio

Posted 22 February 2012 - 09:35 PM

Chuck e Cheese! That's where I saw this type of thing before! It took a picture of you and then drew out a sketch that you got to watch on a screen! You could always try to do that? There was a .dll that I recently saw, I don't recall the name, but it allowed you to take a snapshot with a connected webcam, so I assume if you were to use that .dll, take a picture when they clicked the button, and then drew it out for them, that would be a cool feature!

Thanks, but that's actually very different. I suppose this could work with images instead of text, but it would require some way to crush the colors in the image (i.e. convert it to black-and-white without any colors or even any grays), and I don't know how to do that. Another method would require getting the color of the pixels each step, which in GM is very slow. I could try if you want...actually, it sounds like a cool idea, so I might try anyway :) .

-IMP

*EDIT* Turns out that color crushing is really easy to do :P . Unfortunately, the ZagArt result of an image isn't very pretty at all. This process is just not suited for images. Realize it's not just sketching the image; it's following paths manipulated by the image. And ZagArt + images = no. Sorry.

Edited by IceMetalPunk, 22 February 2012 - 10:06 PM.

  • 0

#14 sasuke12

sasuke12

    GMC Member

  • GMC Member
  • 163 posts

Posted 22 February 2012 - 10:33 PM

It's cool, it was just an idea!
  • 0

#15 ziggler1

ziggler1

    GMC Member

  • GMC Member
  • 378 posts

Posted 23 February 2012 - 01:56 AM

Posted Image

I think this program was inadvertently meant just for me. :wub:
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users