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 Fri 17 Nov 2017, 19:34
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 6 of 7 [94 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
wjaguar

Joined: 21 Jun 2006
Posts: 335

PostPosted: Fri 11 Mar 2016, 10:08    Post subject:  

don570 wrote:
Code:
-f/open='/tmp/tmp.svg' undo=1  -image/scale w=x0.5 h=x1.2

When you know the desired size in pixels, it is better to load the SVG pre-scaled, than to scale it afterward; the resulting image will be sharper that way.
Like this:
Code:
-f/open=test.svg width=512 height=256

Or you can set only one dimension, then the other will be scaled as per aspect ratio.
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 12 Mar 2016, 17:16    Post subject:  

Here's a quick way to put a black outline around colored text
using a script...

Here is what the image looks like after saving with transparency="0"
Checkerboard area is the transparent area.
I then saved to clipboard 1 for future use.

I made a light blue image and pasted clipboard 1 inside for the final image.



Code:

#! /bin/bash
# script to outline text

mtpaint --cmd   -f/new w=250 h=150 =24   -e/col a=0 -s/all -e/cut -e/col a=1  -e/freetype font='Nimbus sans L' antialias=0 size=70 back=-1 angle=0  -e/freetype t=mtPaint -e/paste  \(10,10\) -effect/gaussian=3  -f/as=/tmp/temp.png transparency="0"  -s/all -e/copy  -e/'Save Clipboard'/1   -e/col a=6 -s/all -e/cut  -e/'Load Clipboard'/1  -e/paste  -f/as=/tmp/temp.png -f/open=/tmp/temp.png -effect/gaussian=1    -f/as=/tmp/temp.png



Notes:
-e/paste \(10,10\) ---> I found that slight offset was needed to keep
text in document.

-effect/gaussian=3 ---> this puts the black fringe around text.
This is normally a bad thing Rolling Eyes but it is used to put
outline around colored text in this example.

-effect/gaussian=1 ---> this removes jagged edges, however it's not
essential.

Final result..

Last edited by don570 on Sat 12 Mar 2016, 17:40; edited 2 times in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 12 Mar 2016, 17:19    Post subject:  

Here's a quick way to put a gradient in your text.
Note however that there is a bit of jaggedness because no
gaussian blur was used.

Notes:
-e/paste \(10,10\) ---> I found that a slight offset was needed to keep
the text entirely in document

antialias=0 must be used for the font of text

transparency="0" ---> makes the black of text transparent

You can check what clipboard 1 looks like by making your user home folder show hidden files

-e/"Load Clipboard"/1 -e/paste ---> the paste will set the clipboard in image

A gaussian blur won't work in this example because of the fringe effect
around edges.

Code:

#! /bin/bash
# script to make gradient text

mtpaint --cmd   -f/new w=250 h=150 =24  -e/col a=1 -s/all -e/cut -e/col a=0  -e/freetype font='Nimbus sans L' antialias=0 size=70 back=-1 angle=0  -e/freetype t=mtPaint -e/paste  \(10,10\)  -s/all -e/copy -f/as=/tmp/temptext.png transparency="0" -s/all -e/copy  -e/"Save Clipboard"/1  -e/set grad=1 -e/col a=0 b=115  -e/tool grad \(0,0 0,100\) -e/tool grad: type=lin ext=mirror  -s/all -s/fill  -e/"Load Clipboard"/1  -e/paste -f/save=/tmp/temptext-gradient.png


Back to top
View user's profile Send private message 
wjaguar

Joined: 21 Jun 2006
Posts: 335

PostPosted: Sun 13 Mar 2016, 20:46    Post subject:  

don570 wrote:
-f/as=/tmp/temptext.png transparency="0"

Now that I fixed pref scripting in 3.49.01 Smile the proper way to set transparent color is through pref window: "-i/pref trans=0"
Another route is through layers window, it always worked: "-e/layer trans=0"
No need of a dummy save operation.
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Mon 14 Mar 2016, 14:12    Post subject:  

Quote:
No need of a dummy save operation.

Good info! Thanks.

__________________________________________


The outline can be made in any color that is available in the palette.
Here are two examples created from one script
Code:

#! /bin/bash
# script to outline text

mtpaint --cmd   -f/new w=250 h=200 =24   -e/col a=1 -s/all -e/cut -e/col a=0 -e/freetype font='Nimbus sans L' antialias=0 size=70 back=-1 angle=0  -e/freetype t=mtPaint -e/paste  \(10,10\) -e/col a=2 -e/freetype t=mtPaint -e/paste  \(10,90\)  -effect/gaussian=3  -f/as=/tmp/temp1.png transparency="1"  -s/all -e/copy  -e/'Save Clipboard'/1   -e/col a=6 -s/all -e/cut  -e/'Load Clipboard'/1  -e/paste  -effect/gaussian=1 -f/as=/tmp/temp2.png





______________________________


When using the text tool, there are several characters that need protecting
with the back slash

( ) $ ; &

________________________________________
temp2.jpg
 Description   Final result of running sript
 Filesize   18.67 KB
 Viewed   374 Time(s)

temp2.jpg

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


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Tue 03 May 2016, 19:58    Post subject: Chrome effect with mtpaint  

Chrome effect with mtpaint

MtPaint doesn't have a Chrome effect but I found a solution that
results in a high quality chrome effect with no jagged edges!!

- instructions - chrome effect

-launch mtpaint
-use paintbucket to make white document image
-use text tool to put large black characters in image (see below)
-save as png to disk ---> /root/image.png



- use imagemagick 6.9.8 and chrome script
from Fred's site to make a chrome effect
Note: Chrome script must be in executable path



- in terminal type

Code:
chrome -i 100 -n 2 -s 3 -a 135 -e 45 -c white  -b none  -d 1 -B 0 -A off  /root/image.png /root/chrome.png


---> chrome.png is output image

- open output file with mtpaint (see image)




- add a new layer
Layer > New layer (24 bit)

Put it underneath the chrome image. (click on down arrow)

- Turn on gradient tool and put in an interesting gradient with paintbucket
Example has simple linear red-to-black gradient

- Make a composite image (see result below)
Layers > Composite to New Layer



You can now delete the other layers if desired

- Make the grey color transparent

Palette > Palette editor
- use dropper and click on grey portion of image . This makes grey the color 0 (see below for example)



-save composite image as png with transparent color 0
Here is the final image...



The checkerboard indicates transparency.
Note that there is no jagged edges so you can use on any background
and get professional results.
_________________________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 09 Jul 2016, 16:25    Post subject: Tip : Create a random pattern that repeats without a seam  

Tip : Create a random pattern that repeats without a seam

using mtpaint

1) Use mtpaint to open an image of a pattern that is fairly random

2)make a selection that is nearly square.



3) Crop command

4) Now make the picture square - The number of pixels must be divisible by 2 (In the example the image is 400 by 400)

Image > Scale Canvas

5) Now resize with an offset of half (see image for an example - half of 400 is 200)



Here is the result ....


6) Use smear brush to eliminate horizontal and vertical seams, but do not alter the edges of image.




7) You can now make a larger document which won't have seams
and will appear random -->
Image > Resize Canvas

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


Joined: 02 Mar 2014
Posts: 675

PostPosted: Sat 09 Jul 2016, 16:55    Post subject:  

@don570

Nice tuts, please keep them coming.
Back to top
View user's profile Send private message 
learnhow2code

Joined: 12 Jun 2016
Posts: 1015

PostPosted: Sat 09 Jul 2016, 17:28    Post subject:  

i was already a fan before i knew it could do stuff like this.

havent found (or looked for) any info about it until i came to this forum. thanks very much.

_________________
users | devs
fig os 1.3 md5
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Mon 11 Jul 2016, 15:37    Post subject:  

I got the tip from a Blender user video. Photoshop was used
but mtpaint is nearly as good. Laughing
__________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Mon 11 Jul 2016, 16:44    Post subject:  

Here's the video about pattern painting using Blender.
Well worth watching

https://www.youtube.com/watch?v=7FobUOuISak
_______________________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 23 Jul 2016, 16:33    Post subject:  

I was able to make a default background without using a disk clipboard.
Instead I used the layers feature. (as suggested by Wjaguar)
Should be faster and safer.

Here was the first command...

Code:
mtpaint --cmd  -f/open='/tmp/clock.svg'  -s/all -e/copy -e/'Save Clipboard'/9 -f/new w=1184 h=624 =24   -e/col a=0 -s/all -e/cut -e/col a=9  -e/freetype font='DejaVu Sans' antialias=0 size=70  back=-1 angle=0  -e/freetype t='Fatdog Arm 4' -e/paste  \(470,460\) -effect/gaussian=3  -e/layer trans=0 -effect/gaussian=1  -s/all -e/copy  -e/'Save Clipboard'/8 -e/set  grad=1 -e/col a=0 b=173 -e/tool grad \(300,200 700,500\) -e/tool grad: type=lin ext=mirror     -s/all -e/cut  -e/'Load Clipboard'/8  -e/paste -effect/'Soften ...'=50  -e/'Load Clipboard'/9  -e/paste  \(700,90\)  -f/as=/usr/share/backgrounds/default format=jpeg



I modified it to the following

Code:
mtpaint --cmd    -f/new w=1184 h=624 =24   -e/set  grad=1 -e/col a=0 b=173 -e/tool grad \(300,200 700,500\) \
      -e/tool grad: type=lin ext=mirror     -s/all -s/"Fill Selection"  \
         -layer/new  -f/open='/tmp/clock.svg'  -s/all -e/copy  -layer/"Remove All Layers"   -e/paste  \(700,90\) \
      -layer/new   -e/col a=9  -e/freetype font='DejaVu Sans' antialias=0 size=70  back=-1 angle=0  -e/freetype t="Fatdog Arm"\
        -e/paste  \(470,460\) -effect/gaussian=3  -e/layer trans=0 -effect/gaussian=1 \
       -layer/"Composite to New Layer" -f/as=/usr/share/backgrounds/default format=jpeg
 



Note that -e/layer trans=0 is used to make the text layer transparent

The clock image is copied to the clipboard and the layer is removed

____________________________________________________

Last edited by don570 on Mon 25 Jul 2016, 15:25; edited 2 times in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 23 Jul 2016, 16:40    Post subject:  

to create a layer that has the opacity at 66% and black is transparent
Code:

-layer/new  -e/layer opa=66 trans=0

______________________________________________

Brush size can be set which is useful for tools like lines and circles ellipses...
However you will need to experiment for the appropriate number

Code:
 -e/brush=5


_____________________

A line can be made once the size is set. (The size is one pixel by default!)
Code:
-e/tool line \(74,174 612,174\)


Protect the round brackets if you are running a regular script.

Last edited by don570 on Wed 27 Jul 2016, 19:33; edited 4 times in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Wed 27 Jul 2016, 18:51    Post subject:  

Here some examples of using the script window...
Warning. There can be problems copying scripts from a html page so
if you are having problems then eliminate the line endings and
run the script as just one line.
Also previous settings of mtpaint may affect output. For instance if the gradient tool
is set to 'Reverse' the gradient


First example - Outline a circle

Note that the mtpaint window will show transparency, but since the
output is a jpeg image, there is blackness around the circle.

The round bracket characters don't need protection in the script window.
They do if you are running a regular script.
Note the brush size (which is intended for air brushing).

Code:
-layer/new =24  -e/layer  trans=0 -e/col a=7 -s/all (10,10 100,100) -s/"Fill Ellipse" -e/brush=3  -e/col a=14 -s/all (10,10 100,100) -s/"Outline Ellipse"    -f/as=/root/image format=jpeg



_____________________________________________________

A white triangle can be made by selecting a triangle then cutting (with a=7).
An "outline selection" can be added to make the red outline (a=14).

Note the brush size (which is intended for air brushing)
The output is a png file so transparency is shown with a checker pattern.

Code:
-layer/new =24  -e/layer  trans=0 -e/col a=7 -s/all (10,10 100,100 15,200) -e/cut  -e/brush=3 -e/col a=14 -s/all (10,10 100,100 15,200) -s/"Outline Selection"    -f/as=/root/image2.png



____________________________________________________

To put the shine on the side of a sphere, rather than the middle ---> 2 spheres were created
This required a transparent layer on the background layer.
A third composite layer was created and it was transparent as well so the png file shows transparency.

Code:
-f/new w=313 h=345 =24 -e/col a=1   -s/all  (0,0 90,90) -s/"Fill Ellipse"    -layer/new  -e/layer trans=0 -e/col a=1   -e/set grad=1  -e/tool grad: type=rad ext=none grad=rgb  opac=only -e/tool grad (55,55 75,75) -e/col a=7  b=1  -s/all (0,0 200,200) -s/"Fill Ellipse" -layer/"Composite to New Layer" -e/layer  trans=0  -f/as=/root/image.png





Note that the selection -s/all (0,0 200,200) is chosen to be big enough to fit in both the spheres.



_________________________________________________

Last edited by don570 on Thu 28 Jul 2016, 14:17; edited 2 times in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Thu 28 Jul 2016, 14:07    Post subject:  

As a comparison with the shine on side here is an example with the shine in middle. It may be simpler to write code but it doesn't look as good.

Code:
-layer/new =24 -e/col a=7  b=1  -e/layer trans=0  -e/set grad=1  -e/tool grad: type=rad ext=none grad=rgb  opac=only -e/tool grad (50,50 70,70)  -e/col a=7   -s/all  (0,0 90,90)   -s/"Fill Ellipse"   -f/as=/root/image2.png


_____________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 6 of 7 [94 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
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.1215s ][ Queries: 12 (0.0082s) ][ GZIP on ]