Pixelation

General => General Discussion => Topic started by: HarveyDentMustDie on January 08, 2014, 11:55:29 pm

Title: Pixel perfect drawing tool (prototype)
Post by: HarveyDentMustDie on January 08, 2014, 11:55:29 pm
Not mine. Found it on reddit, and I think that it may be useful for someone here.  :crazy:

IMO it has good idea, and good realization so far. :y:

http://deepnight.net/pixel-perfect-drawing/ (http://deepnight.net/pixel-perfect-drawing/)
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Vagrant on January 09, 2014, 12:30:28 am
Oh my..  :'(


It's beautiful.
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Ai on January 09, 2014, 12:43:01 am
I see. He tracks the last 3-4 pixels plotted in order to decide a 'line direction', and erases the worst outlier.

This is quite good and I would like to see it in GraFX2.
Title: Re: Pixel perfect drawing tool (prototype)
Post by: PixelPiledriver on January 09, 2014, 12:58:36 am
Sharp turns can punch holes in your line.
Some more cases could be considered.
But its a good start on something optional.
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Helm on January 12, 2014, 01:53:25 am
This is useful for rapid sketching of stuff that will eventually become pixel art. Good job.
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Dusty on January 12, 2014, 03:54:11 am
Sharp turns can punch holes in your line.
Some more cases could be considered.
But its a good start on something optional.
I would rather clean up a rogue hole or two than clean up the typical mess of drawing some lines with a pen tool. But I agree, it tends to cut out the corner of a 90degree turn and "soften" the corners. It may need just one more check in there to determine a true corner over a sharp change in direction(which both produce an L shape).
Title: Re: Pixel perfect drawing tool (prototype)
Post by: astraldata on January 14, 2014, 07:54:31 pm
Sharp turns can punch holes in your line.
Some more cases could be considered.
But its a good start on something optional.
I would rather clean up a rogue hole or two than clean up the typical mess of drawing some lines with a pen tool. But I agree, it tends to cut out the corner of a 90degree turn and "soften" the corners. It may need just one more check in there to determine a true corner over a sharp change in direction(which both produce an L shape).

100% agree. Adding pixels is easy. Removing them from a sloppy line tool tends to be a LOT harder.

We should demand no further releases of our favorite graphics editors unless it includes this tool by default! :D
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Arne on January 18, 2014, 11:21:06 pm
Didn't a lot of older paint programs (e.g. DP) use poly lines for drawing? They worked by drawing a line between old mouse pos and new mouse pos. I did a 2 minute test program and discovered that you can actually get "fat" turns if you draw slow enough with such a tool:

(http://androidarts.com/pixtut/PolylineDrawtest.png)

...but I think this can be remedied by keeping an eye at the velocity of the line (mouse delta) or by remembering 3 time points which must be separated by a certain distance, then doing a spline line or whatever. Should give very smooth lines. The three points suggest the intent of the line to some degree, something which is a bit harder to know if analyzing the pixels after they have been rasterized and you're doing image analysis. Also, no line crossing problems.

As someone who mainly does tiny sprites this is of little use to me however. Seems like it would be more useful for Fighter sprites and pixel art drawings.

Same primitive program as before but with much more delay between sample points:

(http://androidarts.com/pixtut/MoreLines.png)

Really fast lines becomes zigzaggy of course, but as mentioned above, this could be fixed.

With the pencil tool, Photoshop single-plots really rapidly it seems. Unsure if you can set it to drawing lines instead.

BlitzMax Sauce (added some comments):
Code: [Select]
Strict

AppTitle="Single buffer polyline"
SetGraphicsDriver GLMax2DDriver(), 0 ' Need GL for single buffer apparently.
Graphics 640, 480, 0, , 0 ' Main screen turn on.
SetClsColor 225,220,200 Cls

Global mx, my, myold, mxold, mbold

Repeat
mxold = mx
myold = my
mx = MouseX()
my = MouseY()
If MouseDown(1)
' If the line is not continuation of old one (click is fresh) then...
If mbold = False Then mxold = mx myold = my mbold = True ' ...lazily set old coords to new.
' Now draw a line using some kind of DDA I don't know the name of.
SetColor 20,40,40
DrawLine mxold,myold, mx,my
Else mbold = False EndIf ' No line.

If MouseDown(2) ' Eraser
SetColor 225,220,200
DrawOval mx-3,my-3,6,6
EndIf

glFlush ' Go GL pipes! (Draw.)
Delay 50 ' ...in millisecs, adjust to suit pleasant drawing tempo.

Until KeyHit(KEY_ESCAPE) Or AppTerminate()
' The
End

Another drawing (http://androidarts.com/pixtut/Polyline.gif). Obvious accuracy/tablet sensitivity problems drawing without zoom of course. (Flood fill in PS because I'm not writing a flood fill).
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Ai on January 19, 2014, 10:47:57 am
Didn't a lot of older paint programs (e.g. DP) use poly lines for drawing? They worked by drawing a line between old mouse pos and new mouse pos. I did a 2 minute test program and discovered that you can actually get "fat" turns if you draw slow enough with such a tool:

(http://androidarts.com/pixtut/PolylineDrawtest.png)

...but I think this can be remedied by keeping an eye at the velocity of the line (mouse delta) or by remembering 3 time points which must be separated by a certain distance, then doing a spline line or whatever. Should give very smooth lines. The three points suggest the intent of the line to some degree, something which is a bit harder to know if analyzing the pixels after they have been rasterized and you're doing image analysis. Also, no line crossing problems.

Are you suggesting a hybrid polyline/spline tool?
That seems like an interesting experiment.

Quote
As someone who mainly does tiny sprites this is of little use to me however. Seems like it would be more useful for Fighter sprites and pixel art drawings.

Same primitive program as before but with much more delay between sample points:

(http://androidarts.com/pixtut/MoreLines.png)

Really fast lines becomes zigzaggy of course, but as mentioned above, this could be fixed.

With the pencil tool, Photoshop single-plots really rapidly it seems. Unsure if you can set it to drawing lines instead.

Can't you just hold down shift?
BTW, GIMP implemented a partial fix for the pixel-crowding/over-drawing, way back at version 2.4, IIRC. It increases the brush spacing as the brush dimensions shrink. Reasonably effective.

Anyway GrafX2 has a dedicated polyline tool. I never use it, polylines feel quite awkward to me. GIMP has a polyline 'Tool' (hold Shift during use of Pencil tool) which is a little better because you can freely mix  freehand and polylines just by releasing/pressing Shift. Krita also has a polyline tool (and it will happily draw unAAed strokes, but I haven't found any pixel brushes yet.)


EDIT:
GrafX2 appears to have long since implemented pixel-perfect drawing for the spline tool.. but only the spline tool. (?)
Title: Re: Pixel perfect drawing tool (prototype)
Post by: surt on February 03, 2014, 09:22:08 am
Just built aseprite and it has this feature (at least in the current development version):
(http://img.uninhabitant.com/aseprite_pixel_perfect.png)
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Ai on February 03, 2014, 11:35:46 am
Thanks for the heads up Surt!

(http://i.imgur.com/MeoJUB8.png)

I feel like it might be worth learning Aseprite now, even though I feel strongly that its zoom system is stupidly implemented (zoom in/out progressively only if you have a mouse with a wheel, what?!).
Title: Re: Pixel perfect drawing tool (prototype)
Post by: astraldata on February 11, 2014, 01:52:21 am
Just built aseprite and it has this feature (at least in the current development version):
(http://img.uninhabitant.com/aseprite_pixel_perfect.png)

Mind sharing the binary with those of us who'd like to try it, yet can't build it ourselves?

Also, judging from the screenshot, the curves in the line don't seem quite as nice as the one in the prototype mentioned by the OP, though I think anything is better than nothing for most folks.
Title: Re: Pixel perfect drawing tool (prototype)
Post by: Kasumi on February 11, 2014, 02:23:02 am
Mind sharing the binary with those of us who'd like to try it, yet can't build it ourselves?
Provided you're on Windows, there's already a public beta.
www.aseprite.org/beta