We are about to switch to a new forum software. Until then we have removed the registration on this forum.
A sketch for painting (updated 3 july 2017).
News:
1) Tool: ARGB random
2) Tool: BACKground creator
Layers github
'TAB' toggle menu on/off
'P' pencil
'L' Liner
'Q' quad
'C' circle
'E' eraser
'F' fill
Zoom with 'z' (then +/- to change magnify)
'U' Undo (10)
'R' Redo
'X' draw with X mirror
'Y' draw with Y mirror
'[' and ']' -/+ brush size
CTRL-drag on canvas --> change brush size
'Backspace' Clear active layer
'Space' toggle active layer visibility
CTRL-click on layer name to rename it
UP and DOWN arrows change order of layers
LEFT and RIGHT arrows change palette
'1..6' set active layer 1..6
Press SHIFT to pick a color from active layer
CTRL-click on +/- --> +/- 10
ALT-click on +/- --> +/- 100
'G' snap to grid (liner, quad and circle)
'K' constrain quad and circle to square and circumference
'ESC' change cursor color (white/black)
'H' to highlight cursor (for small brush size)
'.' to hide layer control
'I' Ink brush
'T' Stamp brush
'D' DynaDraw (Paul Haeberli 1989)
'M' Mixer brush
'N' Clone brush
'B' web brush
Alpha Paint (paint with alpha)
RGB Paint (paint with R,G,B channel)
HSB Paint (paint with H,S,B channel)
You can lock painted pixels and transparent pixels when paint.
Press '=' to reset values.
See keyboard.pde for all defined shortcuts.
Hints and bugs report are welcome :)
cameyo
p.s. menu and more layers are cpu intensive... then draw with menu off.
Comments
Nice work ! The GUI is cool.
I have noticed some fps drops while drawing (drop to 20).
@Castaneche: not optimized :(
Try to draw with menu off.
You do not like this program? :)
I'm looking for suggestions for improvement ... ;)
It is really good work. Thxs for sharing!
Kf
update 28 february 2017 :)
Update version 5 march 2017.
With layers, undo, redo, snap to grid, X and Y mirror...
Kudos @cameyo! It looks pretty neat.
Kf
Very nice program. A couple minor suggestions:
1. Permit keyboard value entry for colors, so I can type a value like 243.
2. Support the use of Shift when drawing shapes and lines.
This will draw vertical or horizontal or 45 degree diagonal lines and perfect squares or circles.
3. Put a wire handle on your paint bucket icon to make is clearer as to the function.
4. I may be missing something, the menu obscures a portion of the canvas. Either restrict the canvas to the visible portion or add a menu feature to hide/show or make it it's own window, permitting full visibility of the canvas. Or maybe make the menu a dummy layer. --- Never mind I found the Tab hide/show menu feature.
A very nice program, I will be using some of the approaches myself. Thanks for sharing.
Minor bug: Typo, no uppercase w:
if ((key=='w') || (key=='w'))
@jas0501: thanks for your hints.
1) i find click (+/- 1), control+click (+/- 10), and alt-click(+/- 100) are good to change RGB and HSB.
2) you can press 'k' when drawing to draw perfect square and circle. For lines you can snap to grid to allow 45 degree or similar.
3) i will change the paint bucket icon :-)
Feel free to use all the code you need ;;)
I have posted a new version (see first post to download).
- Added an HSB color selector (shift-click to select color, shift+right click to move HSB control, space to hide/show).
- Added a function to 'j' key to draw a palette at mouse position with 11 colors ( from current color to old color).
- now open and save functions are folder based (select a folder to save or open all the layers). More, you can load an image on a layer.
p.s. see the keyboard.pde file to see all the shortcuts ;)
cameyo
New version with DynaDraw brush (http://www.graficaobscura.com/dyna/)
Paul Haeberli (1989):
"The program Dynadraw implements a dynamic drawing technique that applies
a simple filter to mouse positions. Here the brush is modeled as a physical
object with mass, velocity and friction. The mouse pulls on the brush with
a synthetic rubber band. By changing the amount of friction and mass, various
kinds of strokes can be made. This kind of dynamic filtering makes it easy
to create smooth, consistent calligraphic strokes."
It's very fun.
cameyo
p.s.
k -> hooke constant
m -> mass value
f -> friction (damping) value
d -> ductus (pression/velocity brush size)
b -> min brush size
B -> max brush size
Nice work, I downloaded the project and I'd like to rewrite your HSBcontrol, making it bigger and faster.
online example
Far better than mine :)>-
Fell free to do what you want with it. :)
New version with Stamp brush, HSB bigger and faster, Manual (PDF).
Have a nice day.
cameyo
New version with Mixer/Smudge brush, better Stamp brush and Manual (PDF).
cameyo
This project has really come a long way in a short time, @cameyo -- hard to believe that your "Pencil Kid" sketch was only two months ago.
@jeremydouglass: it would not have been possible without the help of people like you :)
New version with:
1) Clone brush (with Aligned option) (right click to set clone start point)
2) better Mixer/Smudge brush (linear smudge)
3) select color from HSB control with right button click
4) Manual (PDF) (press F1)
cameyo
New version with:
1) Web brush
2) Stamp brush user defined (capture an area and use it as brush)
3) More preset for DynaDraw (random too)
4) Manual (PDF) (press F1 to view)
cameyo
New version with:
1) Web brush with a lot of options
2) Manual (PDF) (press F1 to view)
3) optimization of some brush
cameyo
Woohoo! The "web brush" is a lot of fun.
Have you considered posting this to a public github repository? Doing so would also archive the various releases of your program, and allow people to contribute back suggested improvements.
@jeremydouglass: yes, i must do it :)
New version with:
1) Select Tool: select a rect area, move selected area with arrows.
Now you can paint (or erase) only within selected area.
Selection can be snapped on grid.
It works with ALL the the painting tool.
'0' --> Select tool
'F3' --> enable/disable selection.
2) some optimization
cameyo
@cameyo
May I suggest creating small clips showing each of your new features? It will be good for documentation and showing all these new changes. You can do this easily with the Video Export library. Thanks for sharing btw!
Kf
@kfrajer
Here is a fast video with some infos: Download Layers video
There is a PDF manual too with the code :)
New version with:
1) github repository
2) Stencil Tool: select tool, move selected area with arrows.
Now you can paint only within stencil transparent area.
The next version will allow to load user stencil.
cameyo
News:
1) github repository
2) New icons with shortcuts
3) Stencil Tool: move stencil (arrows), load stencil, create stencil from selection, show/hide -> F4
The Stencil fills transparent pixels (not black or white).
4) Selection with all painting tools: paint (or erase) only within selected area, show/hide --> F3
5) Filler Tool can erase too
Excellent news. What is the link to the new github repo?
Layers github
It is also within first post (after the screenshot image).
cameyo
News:
1) New tool: Confetti
2) Copy& Paste works on selection or entire layer (useful to duplicate layer)
3) Manual updated
Good painting :)
News:
1) New Tool: Shape (load and using SVG to paint too)
2) Better Tool: Selection (copy, paste, draw, save, erase inside and outside)
3) antipanic key (F12)
4) english manual (automatic translation) :)
News:
1) Tool: Alpha Paint (paint with alpha)
2) Tool: RGB Paint (paint with R,G,B channel)
3) Tool: HSB Paint (paint with H,S,B channel)
You can lock painted pixels and transparent pixels when paint.
Press '=' to reset values.
@cameyo do you know if it possible to project a color from RGB to HSB space or vice-versa? No need to implement in your application, but I am asking more about a concept, in case you have done it before...
Kf
@kfrajer What do you mean with "project" ? Convert from/to RGB/HSB ?
@cameyo Yes, convert from one color space to another one. If I have rgb(255,0,0) then what would be the equivalent hsb values.
Kf
@kfrajer This site has formulas and code to convert color data in different color spaces: easyrgb
Anyway, i use the processing functions to convert between rgb <-> hsb.
Nice, thxs @cameyo.
Kf
@Kkrajer -- here are some approaches using:
Note that there are some subtleties to whether
colorMode()
affects the results and depending on what units you are using.News:
1) Tool: ARGB random
2) Tool: BACKground creator
ciao