I’ll add a tutorial deck to the set in the next few days
note: it’s already gone through a big revamp for usability as I tested it under “real” conditions. it’s been massively simplified to three contraptions; card, canvas, and layercake.
patternshop
a compositing tool for cards and ps canvases as layers
direct download of deck: https://codeberg.org/woodring/decker.patternshop/raw/branch/main/patternshop.deck
project and readme, which is pasted below: https://codeberg.org/woodring/decker.patternshop/src/branch/main
see https://codeberg.org/woodring for more decker things
synopsis
It’s a module and several contraptions that emulate layered composited drawing in other drawing tools. Or, “Decker mega-underpaint mode.”
How it works:
-
make a card that you want to be the target of the compositing
-
put the
ps_cardcontraption on that card -
make at least two other cards that will act as drawing layers
-
put the
ps_cardcontraption on each of those cards -
click the
Lcheckbox on those contraptions - they are now layers -
draw on the layers with the Decker drawing tools; you’ll have to switch to drawing mode
-
after done drawing, switch back to interact mode and the target card.
-
press the
Ccheckbox, et voila! layered drawing on cards
hint: reorder the cards to help flip between a layer that you’re currently drawing on. the left and right arrow keys switch between cards.
or
-
make a card
-
put the
ps_canvascontraption on that card -
make at least two other cards
-
put the
ps_canvascontraption on each of those cards -
click the
Lcheckbox on those contraptions - they are now layers -
draw on the layers with the pointer; use the
bandpbuttons to change the brush and palette -
after done drawing, switch back to the target card.
-
press the
Ccheckbox, et voila! layered drawing on the canvases
hint: to save your work, save the deck. all layers will be preserved, cards and canvases. composition and layers will be off the next time the deck is opened, to preserve the current state of the cards and canvases.
even more
-
canvases and cards can be combined. drawing on a layer card will update a canvas target and vice versa.
-
non-composition cards and canvases, i.e., layers, can be copied to each other via
ps_layercake. it’s an upgraded select/rubberband box. if you copy something onto aps_layercake, but it’s on another card - cut the widget, i.e.,ps_layercake, and paste it in the new card. -
layers are semi-permanent, unless they are wiped out with drawing over them or pasting into them with
ps_layercake. saving a deck will retain them between sessions. IMPORTANT: a layer will be wiped if composition is activated. the image will be replaced by the contents of any other active layers. switching from composition to layer is safe, switching from layer to composition is destructive. -
when a saved deck is opened again, composition and layers will be off. this is to ensure your results are not updated until you explicitly want them to be. be mindful though, since layers are off, too. to help protect your drawings, if there are no layers it will explicitly not composite.
-
IMPORTANT there is no undo. save your work, often.
-
a limitation is that compositions do not update if you switch into drawing mode. cards can only be drawn on in drawing mode, which means, compositions will not update again until it is switched back to interactive mode, again. this limitation does not affect canvas layers, as they can only be drawn on during interactive mode. but, Decker’s drawing tools will not draw on
ps_canvases, only cards. free-form sketching with brushes and patterns is available for cavnases.
controls on the ps_card and ps_canvas
-
only on
ps_canvas,vbutton: toggle visibility of drawing canvas from “solid”, “transparent”, “invert” and “none” -
only on
ps_canvas,ybutton: yank the controls away, so they don’t block the corner. therbutton appears on the other side. -
only on
ps_canvas,rbutton: restore the controls after being yanked away -
Ccheckbox: composite - combine all currently active layers and replace the card or canvas image with the layers. this is destructive and will wipe out any contents on that card or canvas. you can have multiple composites on and they will all receive the combined layer results. exclusive with theLcheckbox. NOTE: uncheckingCwill stop composition. this in effect, “freezes” whatever was the last set of combined layers. good for incremental drawing, as now the image can be turned into a layer by checking theLcheckbox. but, checkingC, if it was previouslyL, will wipe the contents of the layer if there is any other active layer. be careful, save often. -
Lcheckbox: layer - activate the card or canvas as a layer. its image will be combined with all other images and output onto active composite cards or layers. all layers are combined in numerical order via their compositing operator. see the following. exclusive with theCcheckbox. NOTE: uncheckingLwill stop combining (composing) this layer with any other layer, so it will stop contributing to any active composite (checkedCcards or canvases) images. checkingLagain will reactivate the layer. but, checkingCwill wipe the contents of the layer if there is another active layer. be careful, safe often. -
+/-buttons: increases/decreases layer number. the smallest layer is on top, with larger numbers after; i.e., compositing happens in numerical order, such that the top layer (smallest number) is added first. has no effect in composition mode. -
number box: shows the layer number for that
ps_cardorps_canvashas no effect in composition mode. -
</>buttons: switch the compositing operator. it starts in under (u) mode, i.e. underpaint - which is probably what most people want. the order of operators is, starting withu:+,-,*,&,|,<,>,=,o,ucompositing operators are: “what’s being done per pixel between the image stack and the next layer being added.”ostands for “over,” i.e., layer goes on top of everything. has no effect in composition mode. -
text box: shows the current compositing operation for this layer; i.e., given the previous layers, what does this layer do to the stack of images, since it’s a cumulative effect. has no effect in composition mode.
-
only on
ps_canvas,bbutton: change the brush. it will ask you for the name or number for the brush. to change the brush in Decker card drawing mode, use theStyle->Brushmenu like normal. custom brushes created byps_layercakecan be used. has no effect in composition mode. -
only on
ps_canvas,pbutton: change the pattern. it will ask you for the number for the pattern. to change the pattern in Decker card drawing mode, use theStyle->Patternmenu like normal. has no effect in composition mode.
controls for ps_layercake
a copy & paste tool for cards and layers. think of it as select/rubberband box that has a few more features.
layercake operates in interactive mode. grab the corner handles to move it around and resize it. note: you cannot paste into an active composition target - it will be immediately replaced. paste into a layer - or - turn off composition.
hotkeys drive the other functions:
hotkeys
-
c> copy from the card background. completely replaces the contents of the layercake buffer. see merge up. -
v> paste to the card background. completely replaces what the layercake covers. see merge down. -
n> merge up, i.e. composite copy from the card background, treating pattern 0 as transparent. a non-destructive copy. -
m> merge down, i.e. composite copy to the card background, treating pattern 0 as transparent. a non-destructive paste. -
d,f,h,j> copy, paste, merge up, merge down for a canvas, rather than a card. if you have multiple canvases on a card, will try to do all of them. -
b> turn the layercake contents into a custom brush. it will ask you to name the new brush. -
w> wipe/clear layercake -
t> toggle/cycle through visibility modes; solid, transparent, invert, and none.
NOTE: pasting or merging into an active composition card or canvas will have no effect. this is because it will be immediately replaced by any active layers, replacing whatever was pasted into that composite. turn composition off if you want to paste into a composite. but, if composition is turned on again, the pasted contents will immediately be lost.
usage notes
-
reminder: save your deck frequently. there isn’t undo.
-
reminder: while
Cis checked, the card or canvas is an active composition and will receive updates from active layers. uncheckingCwill deactivate composition and “freeze” the image. it will stop receiving layer updates. whileLis checked, the card or canvas is an active layer and will provide content for active compositions. uncheckingLdeactivate a layer and it will stop being included in any active compositions. -
hint: deactivating a layer makes sense if it might have been a “guide layer” to trace over, like sketching a rough layout or draft. this will remove the rough from the final composites. deactivating a composition makes sense to freeze the image if it is a final or if the image will be used as a layer for a new composition.
-
reminder: when composition is on, anything that you directly draw into composition card or canvas will be immediately wiped by layers. this includes
ps_layercakemerges or pastes. turn composition off if you want to draw on top of a composited layer. -
hint: in general, draw on logical layers not compositions - unless the composition will be turned into a layer. layers are semi-permanent, unless drawn upon, while compositions are dynamic and are actively updated results of combining layers.
-
hint: to trace over the top of an existing layer, use a transparent
ps_canvaslayer with aps_cardcomposition. use thevbutton to toggle visibility modes on a layer. composition doesn’t need to be actively on for the card. but if it is, the card target will show the composition of all of the currently active layers; including the one you’re drawing on if it is active and transparent. -
hint: use the
vbutton to make canvases transparent or hide them to see cards behind them; or other layers if they are on the same card. -
hint: there isn’t a palette contraption, but you can use a card to mark the numbers of brushes and palettes so you can visually refer to them - like a real world palette. also, that provides a way to save custom brushes, too, by marking them on a palette card.
-
reminder: Decker drawing tools can only be used on cards. canvases are restricted to brushes and patterns that can be selected via the
bandpbuttons. -
hint: noted previously, it is possible to copy an image into
ps_layercakeand then cut or copy the widget. pasting layercake onto another card allows you to copy and then paste the image there. this can be done with cards and canvases, too, like normal Decker. this allows you to keep multiple copies of compositions and layers in the same deck, to experiment or back up your work. -
hint: consider composing results onto cards and then removing the
ps_cardcontraption. this makes it so you don’t accidentally turn on composition mode and lose your work. (save often!) -
hint: reorder the cards to help flip between card layers and compositions, like a flipbook.
-
hint: since both canvases and card can switch from composition mode to layer mode - this allows one to work incrementally. compose several layers together, turn layers and composition off, and then copy the results. use the copy as a layer and work from that. this also helps to keep Decker from slowing down, especially if you’re working in web Decker. “baking” several layers into one squashed image means Decker will only need to do a couple of composites, greatly speeding it up.
-
hint: the patternshop module and contraptions can be dropped into any other Decker project and be used as-is. but, all are required, the contraptions and the module: the contraptions require the
psmodule.
TODO
- create a tutorial deck