mtPaint - Simple paint tutorial

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

mtpaint lines

#91 Post by don570 »

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

Code: Select all


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

Image

_________________________________________________________


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

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

Image

_____________________________________________________

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

Code: Select all

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

Image
________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

alpha blend command in mtpaint

#92 Post by don570 »

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

Code: Select all

-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
Image

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


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: Select all

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

Image
____________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#93 Post by don570 »

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)

Image

Use line tool to connect points (See image)

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: Select all

-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


Image

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

Code: Select all

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

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Scaling and tiling in mtpaint

#94 Post by don570 »

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: Select all

-layer/new -image/scale h=x2
To make the object smaller

Code: Select all

-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: Select all

-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: Select all

-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
Image
________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

a selection from GIMP

#95 Post by don570 »

When pasting a selection from GIMP into mtpaint....

The best way is to go to the top menu
Layer > New layer

and from the options choose 'Clipboard'.

This will create a new layer above your old layer.

___________________________________________

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#96 Post by tallboy »

Pity that such a well illustrated thread is almost totally uninteresting to browse without the pics. :(
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Seamless pattern for tiling using scripting

#97 Post by don570 »

Seamless pattern for tiling using scripting
Self made - No photo used


An alternate method that uses a photo is here....
http://murga-linux.com/puppy/viewtopic. ... 022#912022

___________________________________________________

Here is a quick method of making your own seamless pattern.
No photo is used.

First step: make a 400x400 pixel image document.
Second step: Paint randomly with brush while gradient is 'ON'
(see image)
Third step(optional): Use smear brush to put a twirl to pattern .

See next post.....
Attachments
first.gif
(102.56 KiB) Downloaded 621 times
Last edited by don570 on Thu 22 Mar 2018, 23:56, edited 2 times in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

continued from above

#98 Post by don570 »

...continued from above.

Fourth step: Resize to 800x800 pixels (see image)
Image > Resize with tile option 'ON'


Fifth step: A seam will be visible in middle of image. Use your smear brush
to obscure the seam in middle of image.

Sixth step: Run script command to reduce the size of image back to 400x400. The center portion is selected.

image > Script

Code: Select all

-s/all  (200,200 600,600) -image/crop
Press 'Execute' button

The result is a tile-able pattern that is random and seamless. It is 401x401 pixels.

The fact that it is 401x401 pixels rather than 400x400 pixels makes no difference

If you do want 400x400 ---> try

Code: Select all

-s/all  (200,200 599,599) -image/crop
Attachments
first-expanded.gif
(111.55 KiB) Downloaded 610 times
final.gif
(84.38 KiB) Downloaded 619 times
Last edited by don570 on Thu 22 Mar 2018, 23:59, edited 4 times in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

continued from above

#99 Post by don570 »

Gimp and G'mic plug-ins can then add some interesting effects. i.e. 3D and bumping

Here Gimp uses a photo....
https://www.youtube.com/watch?v=TKhs7F0hAik

__________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#100 Post by don570 »

Dmitry suggests to solve 401x401 image size problem
a different command....
For a corner&size format, there is the syntax "(200,200,600,600)" or
the explicit "x=200 y=200 w=400 h=400".
This script gives a 400x400 image....

Code: Select all

-s/all  x=200 y=200 w=400 h=400   -image/crop
________________________________________


When using GIMP

1) to convert GIF format to 24 bit color --->

Image > Mode > RGB

2) to make a 3D effect

Filters > Map > Bump Map

3) to rid image of strange repeating paterns

Filters > Map > Make Seamless

See image for final result. It looks like moss growing on copper.
It will look totally random if 'Make Seamless' command is used
_____________________________________
Attachments
second.gif
(96.99 KiB) Downloaded 568 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

use mtpaint with blender for raised text

#101 Post by don570 »

It is possible to use mtpaint with Blender 2.79 app.

First use mtpaint to make an image with white text on a black background (RGB) then make a gausian difference fuzz so that the result
is like photo below. Save image to disk.

You then launch blender and you can put the raised text to a sphere
(as shown)

Continued in next post.....
Attachments
mtpaint.png
make this text in mtpaint
(8.3 KiB) Downloaded 511 times
finished-noncolor.png
(44.07 KiB) Downloaded 521 times
Last edited by don570 on Wed 11 Apr 2018, 00:17, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#102 Post by don570 »

Here is the node layout for blender using cycles render.

You make a uv layout for a sphere and use the image you made with mtpaint.

The color ramp allows the color white to be controlled. (Move the tab inwards)

Note that non-color data must be used. Very Important!!

Math node is set to 'Multiply' . Use a number from .5 to 22
The color green is fed to a mix shader node.
________________________________________

For a different effect...

Cut a noodle to get rid of white color and show just one color for sphere (as shown below in finished1 example)


__________________________________________________
Attachments
node-layout-blender.png
node layout for blender
(52.67 KiB) Downloaded 506 times
finished1.png
no white color is used
(37.17 KiB) Downloaded 527 times

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

mtPaint as the snapshot app

#103 Post by mikeslr »

Hi don570 and All,

Being a tutorial on how to use mtPaint I thought this was the best place to post this. When it come to Graphics, I'm all thumbs. And while there are other snapshot apps available, I still prefer mtpaintsnapshot for that purpose. It's a built in feature of all implementations of mtpaint, and may have been assigned as the default application to take snapshots. If so, you can just press the "Print scrn" Key.

Some time ago 01micko developed a small script which added a GUI so that rather than immediately taking a snapshot you could choose to delay that for a few seconds while you made any necessary adjustments. See attached screenshot. I packed the script as a pet which added a menu/desktop entry. With that entry, mtpaintsnapshot could be assigned to a launcher on the Taskbar/panel or a desktop launcher/icon. I've attached a copy.

An advantage of using mtpaintshot as the snapshot is that immediately after the snapshot is taken it is automatically opened in mtpaint. You can, of course, immediately close that and precede to take another snapshot. But you can also immediately make quick edits or do all the things mtpaint is really good for, where the availability of "more options" on gimp or other graphic editors adds complexity and just gets in the way.

mikesLr
Attachments
mtpaintsnapshot-GUI.png
mtpaintsnapshot GUI
(15.92 KiB) Downloaded 457 times
mtpaintsnapshot-2.014.pet
mtpaintsnapshot pet
(5.51 KiB) Downloaded 350 times

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

Re: mtPaint as the snapshot app

#104 Post by rufwoof »

mikeslr wrote:An advantage of using mtpaintshot as the snapshot is that immediately after the snapshot is taken it is automatically opened in mtpaint. You can, of course, immediately close that and precede to take another snapshot. But you can also immediately make quick edits or do all the things mtpaint is really good for, where the availability of "more options" on gimp or other graphic editors adds complexity and just gets in the way.
I love mtpaint for screen captures also, but I add a sleep 3 prefix in my jwm configuration before PrintScreen runs mtpaint -s to capture a screenshot, just so I have a little time to perhaps open a menu or whatever to show that also in the screen capture. My other favourite jwm snippets is to have ALT and up or down arrows as adjusting the volume up or down, and I also use jwm config StartupCommand ... to set the alsamixer Master, Headphones and PCM to their maximum levels. Extract of part of my jwm configuration ...

Code: Select all

	<Key key="Print">exec:sleep 3;mtpaint -s</Key>
	<Key mask="A" key="Up">exec:amixer sset Master 1+,1+</Key>
	<Key mask="A" key="Down">exec:amixer sset Master 1-,1+</Key>
	<!-- run amixer sset Headphone 100 (or whatever) to see what the limits/ranges are -->
   <StartupCommand>amixer sset Master 31</StartupCommand>
   <StartupCommand>amixer sset Headphone 31</StartupCommand>
   <StartupCommand>amixer sset PCM 255</StartupCommand>

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Re: mtPaint as the snapshot app

#105 Post by greengeek »

rufwoof wrote:I also use jwm config StartupCommand ... to set the alsamixer Master, Headphones and PCM to their maximum levels. Extract of part of my jwm configuration ...

Code: Select all

	<Key key="Print">exec:sleep 3;mtpaint -s</Key>
	<Key mask="A" key="Up">exec:amixer sset Master 1+,1+</Key>
	<Key mask="A" key="Down">exec:amixer sset Master 1-,1+</Key>
	<!-- run amixer sset Headphone 100 (or whatever) to see what the limits/ranges are -->
   <StartupCommand>amixer sset Master 31</StartupCommand>
   <StartupCommand>amixer sset Headphone 31</StartupCommand>
   <StartupCommand>amixer sset PCM 255</StartupCommand>
Thanks rufwoof - I thought the only way to achieve this was to put a script in /root/Startup but this is a great alternative.
cheers!

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#106 Post by rufwoof »

Whilst all the Puppy 'bloat' i.e. jwmdesktop manager is nice, I find that actually conflicts with a good setup IMO. jwm tray doesn't cater for dragging files to icons in the jwm tray, whereas rox panel does. With all the startup command and jwm/windows configuration in a single .jwmrc file its relatively easy when you have a copy of the associated jwm versions configuration file/document (and a bit of XML skill) to admin/configure things exactly as you'd like.

The way Puppy is structured however with jwm split out and auto-regenerating etc. that can screw up (overwrite) a good manually configured setup. So you have to de-bloat Puppy :)

jwm doesn't support drag/drop across desktops/pinboards either. Personally multiple desktops IMO are only useful if you have multiple monitors, otherwise multiple pinboards can work just as well and you can arrange things to drag/drop across pinboards.

Reducing down the width of the jwm panel and putting that on top of a rox panel is a good combination, as you can drag programs to the rox panel to create a icon, move them around using the middle mouse click/drag and once in place drag/drop files onto them to open up the file using that program. Whilst still having the jwm panel also as per normal (but just reduced width). Leave windows maximised and just flip between them by selecting them in the jwm panel, and that's like having desktop icons in the rox panel so visible even when a window is maximised. Also eliminates the buggy jwmdesktop type issues.

I like to have one desktop/pinboard specifically for 'computer' that contains desktop icons to documentation and to configuration files, so I can just flip to that pinboard in order to make system configuration changes. Another I typically use for bookmarks/web, i.e. switch to that and click a desktop icon as a web link (showdesktop and click another to open another link). Another pinboard for documents/office files/programs, another for music/multimedia ... and that's pretty much it (I also like to have a empty pinboard that I use as a scratchpad/current work/general).

The downside is that the jwm menu isn't auto-updated as programs are installed/removed, however the pinboards in effect become the 'menu' so its relatively easy to add/remove things from those manually. The menu in effect is relegated and not used that often, so much so I don't have a menu button at all, I just set the clock to show the menus when the clock is clicked.

RISC (reduced instruction set computer) on X-Windows (ROX) is great for a mouse heavy style (drag and drop). Shame that its lapsed. Puppy goes some way to avoid it totally fading. jwm is still maintained/updated, but isn't the ideal partner (would be better if its panels supported drag/drop along with dragging/dropping across desktops/pinboards). Supplemented with golden oldies such as mtpaint and the new inroads into running a browser in a container/restricted user (EasyOS) whilst running non internet local things as root and that's a great collective set. The broader general standard Puppy layout/structure however detracts from that IMO. Yes jwmdesktop click to configure options are nice, but tend to lock you into a particular general desktop layout - that isn't the best layout choice IMO.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#107 Post by musher0 »

Hello all.

I finally found the new way to use mtpaint as a viewer, after a couple of
fruitless days trying to make the officially documented ways work.

The answer was in the README in the latest version of mtpaint:
(...)
After installation you can create a symlink to add a viewer command, e.g.

su -c "ln -s mtpaint /usr/local/bin/mtv"

Then you can open some graphics files with "mtv *.jpg". This is
a shortcut to writing "mtpaint -v *.jpg". mtPaint can only edit
one image at a time, but when you have more than one filename in
the command line a window will appear with all of the filenames
in a list. If you select one of the names, it will be loaded.
I find this is helpful for editing several icons or digital photos.
mtv *.<picture type>
is the new way to use mtpaint as a viewer.

The old ways
mtpaint -v *.jpg
OR
mtpaint *.jpg
do not work anymore.

In Puppy, the symbolic link "mtv" is achieved as follows from console:

Code: Select all

cd /usr/bin
ln -s mtpaint mtv
Then you simply drill down into your image
directory and type
mtv *.jpg
or whatever image type, and you have all the image files in the listing on
the right, ready for editing.

You can make yourself a wrapper for this, with its own *.desktop file,
if you hate typing in console.

IHTH
Attachments
mtpaint-as-viewer.jpg
(164.35 KiB) Downloaded 634 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Wognath
Posts: 423
Joined: Sun 19 Apr 2009, 17:23

color code from image

#108 Post by Wognath »

don570, I have consulted this thread countless times. Belated thanks for doing it.

And a question: is there an easy way to grab a color code from a pixel of an image?

Ideally, I could click on a pixel and view the color code as in gimp (FG/BG Color window). A workaround I have found is to select a single pixel, Edit/Copy To Palette. The color code can then be obtained from Colour Editor, and Undo restores the default palette. If a region is selected, then up to 256 colors appear in the palette, which can be saved, if needed. Am I missing an easier way to copy a color? Thanks.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#109 Post by don570 »

to grab a color code from a pixel of an image?
I avoid editing the palette instead I make a foreground color with the eye dropper.
Then I put my mouse in upper left hand part of window and click on foreground color
to display the info about the color.
I believe the eye dropper is used to make copying of a color.
See what the manual says.

_________________________________

Wognath
Posts: 423
Joined: Sun 19 Apr 2009, 17:23

#110 Post by Wognath »

OK--easy as 123
Attachments
Screenshot-8.png
(42.97 KiB) Downloaded 486 times

Post Reply