Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Nov 2017, 11:42
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
mtPaint - Simple paint tutorial
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 7 of 7 [94 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7
Author Message
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 30 Jul 2016, 14:56    Post subject: mtpaint lines  

Here are some examples using the line command...
Vertical or horizontal lines are simple and there is no jaggedness

Code:


-e/brush=3 -e/tool line (10,10 10,100) -s/all (30,10 38,100) -e/cut



Note that the line tool makes the line have rounded ends no matter the brush
size setting. Conclusion the cut method is better and simple to code.



_________________________________________________________


...But there is a problem when the line is at an angle. Jaggedness appears in both methods, but it appears worse in the cut method,
and the cut method is difficult (there's no simple rule to derive the coordinates)

Code:
-e/brush=3   -e/tool line (25,25 50,85)  -s/all (40,26 45,23 96,80 90,86)  -e/cut





_____________________________________________________

It is tempting to use the Free Rotate command to rotate a cut area.

Code:
-layer/new  -s/all (30,10 38,100) -e/cut  -e/col a=0  -image/rotate=45


The result looks nice, because there is a slight antialiasing applied by mtpaint.
However this antialiasing causes problems when using the lasso tool
and pasting the line into another document.
I'll explain in next post.


________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 30 Jul 2016, 15:35    Post subject: alpha blend command in mtpaint  

If the background is white the rotate command still gives good results.
(See image below)

Code:
-layer/new -e/col a=7   -s/all  -s/fill   -e/col a=1  -s/all (30,10 38,100) -e/cut  -e/col a=7  -image/rotate=45




However in a more practical example the line must be lassoed and transfered to another document.

Here is the result magnified several times. See the black fringe affect.



So here is the code that will avoid this fringe affect. It uses alpha blend,
one of the features of mtpaint.
gaussian=1 is fine to get rid of jagged edges.

Code:
-layer/new -s/all (30,10 38,100) -e/cut  -e/col a=0  -image/rotate=45 -s/all  -s/"Lasso Selection"   -layer/new =24  -e/paste (10,10) -effect/gaussian=1 -s/all  -s/"Lasso Selection" -layer/new =24 -e/col a=7  -s/all  -s/"Fill Selection"  -e/col  a=1  b=0 -s/'Alpha Blend'    -e/paste   -f/as=/root/image.png


Code explanation:
- a gaussian blur can only be done with 24 bits of color so start with the
correct document
-Red horizontal line is created with cut command (or fill command if you prefer)
- a=0 ( i.e. black) is needed before rotation to fill triangle edges of rotated document.

- entire document is selected and then lassoed to clipboard.

-pasted to new layer (i.e. a new document) and jaggedness is removed with
the gaussian effect (gaussian=1 )

-red line lassoed again . It is in the clipboard again.

I made a final document (a white image)
Note I filled the document with the color white (a=7).

- -e/col a=1 b=0 was needed for the correct alpha blend procedure in this example
---> Because it was a red line with some black fringing.

- the alpha blend command is applied then finally the paste command.


____________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Tue 02 Aug 2016, 20:20    Post subject:  

Tip to make stars and other objects in mtpaint

The vertices are needed when using a script, so here is what I suggest.

Brush size ---> 1 pixel
Make a square selection with selection tool
Make a circle --->

Selection -> Outline Ellipse

Paint marks an equal space apart along circle circumference(see image)



Use line tool to connect points (See image)



Open text editor and note the vertices
as you hover your mouse over mtpaint window
Coordinates can be read from bottom left of mtpaint window.
Here is the results:

498 239
478 176
526 139
465 141
447 83
425 139
366 144
413 178
392 239
443 201

Now you construct the script commands

Code:
-layer/new -s/all (498,239 478,176 526,139 465,141 447,83 425,139 366,144 413,178 392,239 443,201) -s/fill




For best results you should be using 24 bit color and then doing a gaussian blur
after constructing the star

Code:
-layer/new =24 -s/all (498,239 478,176 526,139 465,141 447,83 425,139 366,144 413,178 392,239 443,201) -s/fill -effect/gaussian=1


Scale document if you want a different size. Then lasso and copy to a final document.
_______________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Wed 03 Aug 2016, 13:51    Post subject: Scaling and tiling in mtpaint  

Scaling and tiling in mtpaint

There are two useful commands that should be noted.
The following command will scale the image by 2. Actually height h
is scaled by 2 . The width w is assumed to be scaled by 2 as well.
Code:
-layer/new -image/scale h=x2


To make the object smaller
Code:
-layer/new -image/scale h=x.25

_________________________________________________________

To resize the document i.e. the layer and tile it at the same time
In this example both height and width are expanded with tiles.
There will be 3x3=9 tiles in total.
Code:
-i/resize =tile h=x3


Now for the final example...

The star is created in 24 bit layer and then made smaller and slightly blurred.
It is lassoed and pasted (using alpha blend method to avoid a black outline)
into the centre of a small white document which is then tiled so
that 3x3 stars are the result.
Code:
-layer/new =24 -s/all (498,239 478,176 526,139 465,141 447,83 425,139 366,144 413,178 392,239 443,201) -s/fill -effect/gaussian=1  -image/scale h=x.25  -s/all  -s/"Lasso Selection" -layer/new     w=50 h=50    =24  -e/col a=7  -s/all  -s/"Fill Selection" -e/col  a=1  b=0 -s/'Alpha Blend' -e/"Paste to Centre" -i/resize =tile h=x3



________________________________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 7 of 7 [94 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0650s ][ Queries: 12 (0.0095s) ][ GZIP on ]