TwelvestoneFlash

Packing problem: programming vs hand drawing: help me argue


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
scudsucker
 
2010-09-09

I have a friend who is a graphic designer. He's doing a flier for a party with this background, and was complaining of the time it took him to draw all those circles.

http://img444.imageshack.us/img444/7204/77158066.png

detail: http://img17.imageshack.us/img17/3087/eddetail.png

Although the image is reasonably complex, I argued that it would not be too hard to write a program (I was thinking flash as2, but 3 would do it, as would processing) to take the outlines of the image and automatically draw circles.

My reasoning is that you'd throw in a few random large circles, then use some kind of physics to move them into position by adding more and smaller circles,. which would jostle and push each other, until the system tended to a state with minimal motion.

This would be when the space inside each outline was optimally packed with circles, and if we assume a maximum and minimum circle size, would not be too hard to code.

He, on the other hand, said it would be far easier to draw.

I'd like to prove him wrong - my AS skills are very shaky (AS1) and I have not done any for years - but first I thought I'd ask opinions here.

[This might belong in projects? Or Flash?]

Storm
 
2010-09-09

If it's print you definitely do not want to be doing anything in Flash.

I can't see the image (blocked at work) but what about brushes in PS?

Any screen-based program is going to output shitty resolution to print a flyer.

DontBogartMe
 
2010-09-09

shit that's a nice idea for an experiment. Wish I had time to give it a go right now. I'll try to come back to it.

DontBogartMe
 
2010-09-09

yeah I don't know about the printing angle, if Storm says it's a no-go, then I guess you're out of luck on that front.

persist
 
2010-09-09

You could do this fairly easily with flash ape physics. Make the outlines invisible and then make a particle brush with some color choice and random size variation.

as for not doing it because it's print, that's just silly.

It's all vector. increase the container clip size to an insane size and take a bitmap of it (http://www.palmerama.tv/2010/01/easy-as3-print-canvas/). Tile it if you need to get even more extreme. Or use bytearray alivepdfhttp://www.bytearray.org/?p=101

scudsucker
 
2010-09-09

Well, the design is done, in vector, and gone to print so that part of the discussion is moot.

But exporting the various vectors would be possible, albeit a bit complicated. (I looked into flash export to svg a while ago so I know that can be done, with difficulty)

It is really just physics and a little randomization, as far as I can tell. I'm going away for the weekend so can't try anything then but next week I'll probably be popping questions in the flash forum.

persist
 
2010-09-09

I already moved it to Flash.

Storm
 
2010-09-09

sure fun experiment but my point was that if he doesn't know how to use brushes then he isn't going to understand print resolution and making it 3x the size to produce it as a bitmap.

Flash's export options are limited and weak. I never said you couldn't do it. But its a lot of extra work for something relatively simple.

[edit]obviously I'm alone so I look forward to seeing the image you posted when I'm not blocked at work. For a designer doing math that sounds like clowntime to me though (referencing azn below). Or is this something the mathematician is trying to do FOR the designer?

Technomancer
 
2010-09-09

can't you import the flash vectors into illustrator?

azninvasion2000
 
2010-09-09

it would definitely be better in a sense to do this via code for the reason that you could adjust the random seed, or tinker with the sizes of the balls or gravity physics to see several variants of this design in seconds versus hand drawing all those balls.

to tweak that all by hand versus tinkering with a few mathematical values seems like clowntown to me.

in any case, i think it looks pretty cool.

arigato
 
2010-09-09

Personally I'd just make symbols of 5 or so different size circles in Illustrator and place them, it wouldn't take much time at all. Though it looks great, drawing each one separately in that complex graphic would have taken plenty of time, though. I bet I could do it faster than any of you could code it. k

Generally I'd avoid doing vector work in Flash nowadays, but I used to do it all the time before Illustrator came up with decent brush, eraser, and trace tools.

persist
 
2010-09-09

I would never expect a designer to understand he needs to increase a movie clip size to get a decent bitmap, which is why I would code it to do that under the covers for him or her when they hit save.

Obviously a one off poster for a designer is not a big deal. But let's say this is the brand motif for a startup. It sure would be handy to build the designers a tool.

Also every image editing program on any computer is screen based.

:pinball:

Storm
 
2010-09-09

And the code naturally writes CMYK output.

persist
 
2010-09-10

Uh, What do you think CMYK does? It's just a color format.

The PDF lib does it. But you can do it too.

And yeah this is actually pretty natural for ActionScript.

var myPic:BitmapData = new BitmapData(myPicHolder.width, myPicHolder.height); var c; var m; var y; var k; var out = []; for (var i = 0; i < myPic.width; i++){ var row = out.push([]); for (var j = 0; j < myPic.height; j++){ c = ~(hex >> 16 & 0xFF); m = ~(hex >> 8 & 0xFF); y = ~(hex & 0xFF); k = Math.min(c, m, y); c -= k; m -= k; y -= k; row.push([c,m,y,k]); } } return out;

Storm
 
2010-09-10

persist, you get so defensive sometimes....it is fun to rile you up. But I LOVE that you write wicked code!! (that I steal and sell on the internet)

I can see the image now that I am home and I stick to what I said and I agree with ari. It would be way easier and quicker for a designer to do that using existing graphics tools than to code that. I never said it can't be done. I just ask why you would.

But now that we've proven that I'm wrong, let's see that bitch printed!! I want it on my wall please.

scudsucker
 
2010-09-10

let's see that bitch printed!! I want it on my wall please. HOT XXX PDF PORN

persist
 
2010-09-10

Storm, I never said you said it couldn't done. You did say the output would be shitty, which is completely untrue. I was only replying to your comments so that people who want actual information on this topic have good info.

But if you're just pushing cause it's fun to watch me reply then I'll just stop.

Storm
 
2010-09-10

No. Don't stop. You know your shit and I don't type just to push.

Everything and anything can be done. But when you're programming there are a HELL of a lot more things to think about to ensure you cover all the bases to ensure it could print out properly. It also depends whether printing to that person means inkjet, fiery, offset print, silk screened, etc.

You have that knowledge and some others here have that knowledge to program it and its a fun experiment. But I think the amount of time taken to do something software already does is a ridiculous amount of time spent.

I'm at work and I can't see the PDF but I'm sure it looks great as a PDF. I have no doubt.

scud, you did the PDF in ActionScript?

DontBogartMe
 
2010-09-10

Storm ... are you trying to wind him up, or is it just accidental?

"scud, you did the PDF in ActionScript?" - that sounds more than a little sarcastic.

Storm
 
2010-09-10

ooh italicized 'trying'......that's like over-trying!! No, I'm not trying. Nor am I over-trying.

I really like how people think I'm an asshole when I'm probably one of the most genuine, sincere, and honest (but blunt honest) guys you'll ever meet.

I asked because if you READ my post right above yours I said: "I'm at work and I can't see the PDF" so I am genuinely, sincerely, and honestly asking: "scud, you did the PDF in ActionScript?"

In future, I will revert to more refined English sentence order and type a correctly worded question such as: "Scudsucker, did you output the PDF you posted directly from ActionScript? I am genuinely interested in your process to further my own knowledge of this debate." in order to clear any confusion about my intentions.

If you think I'm an asshole you will always read anything I type as being an asshole. But if you think I'm a nice caring person, you will read my statements and responses as caring and inquisitive. People are funny creatures and forums are an interesting sociological study.

If I go back to the point of this thread, it was stated: > I'd like to prove him wrong

I actually agree with the person he's debating, so I'm debating. If you can't prove me wrong or convince me its worthwhile then how are you going to convince the designer you're trying to convince?

I'm not a programmer. I hate math. I hate programming. I can write ActionScript. What persist does scares the living shit out of me, but because I like to learn constantly I am intrigued by what he does and the debates I get into with him. But we come at problem-solving from completely different thought processes. He doesn't need defending nor do I. We have no issues between each other as far as I'm aware. [edit]I see he's even dedicated an island to me![/edit] I would like to be convinced this is a worthwhile endeavor for Scudsucker to invest his time in just simply in order to convince his designer buddy it was worthwhile. Can it be done? Sure. Can it be done and outputted at a high-quality? I'm being swayed. Can everyone learn the skills persist provides and execute them in a quick manner to solve the original debate? I'm saying No.

I'm genuinely interested in learning and as I've said a multitude of times on 12s I'm prepared to be proven wrong on anything here. BUT I'm not so easy to convince and I'm always open to being convinced. If by being difficult to convince equals being an asshole, so be it in this case. But it doesn't make me an asshole.

DontBogartMe
 
2010-09-10

I just read the first half of your reply and am busy but want to reply to that...

no of course I don't think you're an asshole, that's why I was asking you to clarify your position with persist.

And yeah, since this thread started with that image which we all know was made by hand, you asking if it was made via ActionScript, in the light of your conv with persist, to me, sounded sarcastic.

I couldn't figure out why you said this: "persist, you get so defensive sometimes....it is fun to rile you up" How is answering the questions and doubts in this thread "getting defensive"?

Storm
 
2010-09-10

only because he goes the extra mile...god love him.....and writes brilliant code when he didn't really need to. It wasn't 'defensive' in the "MUST PUNCH YOU" way. It was 'defensive' in the "I better go above and beyond!" way. He could have said "You can write CMYK color values in the code to output the PS data." and I would have believed him (how could I argue?). That's all. It's all in good fun. I've gotten to know persist quite well I think and he is brilliant so going over the top to defend himself against 'types like me' shows a bit of defensiveness. But not in a negative "You're such a defensive prick" kind of way. It's still 'defensive' but in an endearing way. Agree? Disagree?

DontBogartMe
 
2010-09-10

I dunno how he read it but that's not how I read it.

Love ya!

Storm
 
2010-09-10

u2

persist
 
2010-09-11

The reason I leave code and seemingly overdo it, even steer other threads and ask people to post what code did fix the problem rather than say only "nvm, I got this to work" is because 12s has incredible SEO and people search on Google about these same AS challenges. They land here.

It's about keeping up the integrity of a code forum. As was the tradition at were-here, this isn't banter time. I know people tend to forget, but I mod the Flash forum. I moved the topic here because so many misnomers were being stated as arguments against using Flash for the problem here. And there are valid reasons for not using Flash for this. But that argument cannot rest on the shoulders of misstatements about Flash and frankly deeper concepts of application development that Flash happens to also be capable of. Print information in Flash and any discussion around it is valuable and helps the Flash forum.

Even when I didn't have much time for 12s in 2009 I was popping into the Flash forum to see how things were. Luckily at the time, Flash was in a bit of a lull, and not many people were posting stuffs.

I have no personal agenda other than to not only point out misinformation, but provide correct information.

There's nothing worse than searching a code problem and wasting your time reading a group debate and not coming to any conclusion. And while, you, Storm may have believed me at my say so, our visitors, who are always lurking, don't know, and it would just look like a ranty discussion.

People searching on high dpi print in actionscript will find this, and they won't have scudsucker's requirements, parameters or constraints.

:shrug:

I have no love or attachment to Flash at the moment. I would also suggest Chrome's canvas and Processing for js as an avenue I would investigate before looking to flash. k

TwelvestoneFlash

Packing problem: programming vs hand drawing: help me argue