AuthorTopic: Pixel perfect drawing tool (prototype)  (Read 8474 times)

Offline HarveyDentMustDie

  • 0010
  • *
  • Posts: 469
  • Karma: +0/-0
  • I dream too much.
    • View Profile
    • Deviant Art

Pixel perfect drawing tool (prototype)

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/

Offline Vagrant

  • 0010
  • *
  • Posts: 157
  • Karma: +0/-0
  • At your service.
    • @VagrantPixels
    • http://pixeljoint.com/p/43310.htm
    • View Profile

Re: Pixel perfect drawing tool (prototype)

Reply #1 on: January 09, 2014, 12:30:28 am
Oh my..  :'(


It's beautiful.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Pixel perfect drawing tool (prototype)

Reply #2 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.
« Last Edit: January 09, 2014, 12:53:10 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline PixelPiledriver

  • 0011
  • **
  • Posts: 997
  • Karma: +6/-0
  • Yo!
    • View Profile
    • My Blog

Re: Pixel perfect drawing tool (prototype)

Reply #3 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.
And knowing that it is, we seek what it is... ~ Aristotle, Posterior Analytics, Chapter 1

Offline Helm

  • Moderator
  • 0110
  • *
  • Posts: 5159
  • Karma: +0/-0
    • View Profile
    • Asides-Bsides

Re: Pixel perfect drawing tool (prototype)

Reply #4 on: January 12, 2014, 01:53:25 am
This is useful for rapid sketching of stuff that will eventually become pixel art. Good job.

Offline Dusty

  • 0100
  • ***
  • Posts: 1107
  • Karma: +0/-0
    • View Profile

Re: Pixel perfect drawing tool (prototype)

Reply #5 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).
« Last Edit: January 12, 2014, 03:58:56 am by Dusty »

Offline astraldata

  • 0010
  • *
  • Posts: 391
  • Karma: +1/-0
    • View Profile
    • MUGEN ZERO

Re: Pixel perfect drawing tool (prototype)

Reply #6 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
I'm offering free pixel-art mentorship for promising pixel artists. For details, click here.

     http://mugenzero.userboard.net/

Offline Arne

  • 0010
  • *
  • Posts: 431
  • Karma: +1/-0
  • Panties.
    • View Profile
    • AndroidArts

Re: Pixel perfect drawing tool (prototype)

Reply #7 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:



...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:



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. Obvious accuracy/tablet sensitivity problems drawing without zoom of course. (Flood fill in PS because I'm not writing a flood fill).
« Last Edit: January 19, 2014, 02:19:26 am by Arne »

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Pixel perfect drawing tool (prototype)

Reply #8 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:



...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:



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. (?)
« Last Edit: January 19, 2014, 11:08:44 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline surt

  • 0011
  • **
  • Posts: 570
  • Karma: +0/-0
  • Meat by-product
    • not_surt
    • http://pixeljoint.com/p/2254.htm
    • View Profile
    • Uninhabitant

Re: Pixel perfect drawing tool (prototype)

Reply #9 on: February 03, 2014, 09:22:08 am
Just built aseprite and it has this feature (at least in the current development version):