mtpaint 3.49.12- April 2016

Paint programs, vector editors, 3d modelers, animation editors, etc.
Message
Author
wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#196 Post by wjaguar »

SFR wrote:From what I see, options in 'Image->Preferences' are inaccessible through CLI:
OK, I'll open it for scripting.
However:
echo 'undoMBlimit=128' >> ~/.mtpaint
is a perfectly legitimate solution.
And anyway, the idea was that user's own copy of mtPaint is already configured to his satisfaction. :-)
2. I can't save an image as JPEG (if source image was of a different type), because for some reason JPEG2000 takes precedence over it:
Thanks for noticing this mistake. Now, among matches from the beginning, the shortest will be preferred, instead of the first. Patch is attached.
Btw, any chance for exit code other than 0 in case if an error occured?
Done in the same patch (exit code 1 if error in scripting mode).
Attachments
fix34487.patch.gz
(598 Bytes) Downloaded 293 times

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#197 Post by wjaguar »

Dingo wrote:what library do you recommend for jpeg-2000 support?
Neither. :-) Both are extremely ugly and wasteful.
Jasper is more widespread, and stable (because unmaintained). OpenJPEG has had version 2.0 released in December 2012 but I haven't even tested compiling with it - maybe it had improved, but I've lost all hope already. :-(

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

#198 Post by don570 »

I've made new debian packages for Ubuntu lucid, precise and Trusty tahr.

They work well with scripts 8)

I could use the system clipboard to transfer an image back and forth
between mtpaint and libreOffice writer.

I tested wacom tablet with Ubuntu trusty tahr and it worked well.
The locales worked as well.

Image

_______________________________________________

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#199 Post by SFR »

Thanks a lot for the patch, Dmitry - both things are working fine now:

Code: Select all

# ./mtpaint --cmd -file/open=photo.jpg -image/rotate=45; echo $?
Loading JPEG image - Please Wait ...
********************
You have not allocated enough memory in the Preferences window for this operation.
[ OK ]
1
# 
# ./mtpaint --cmd -file/open=image.png -file/as format=jpeg; echo $?
Loading PNG image - Please Wait ...
********************
Saving JPEG image - Please Wait ...
********************
0
# 
wjaguar wrote:OK, I'll open it for scripting.
However:
echo 'undoMBlimit=128' >> ~/.mtpaint
is a perfectly legitimate solution.
And anyway, the idea was that user's own copy of mtPaint is already configured to his satisfaction. :)
Oh, it's not so crucial - after all the end effect will be practically the same in both cases. :wink:

Thanks again &
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

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

#200 Post by don570 »

version 3.44.88 available on first post

tested with the following commands in terminal...

...To convert to tif

mtpaint --cmd -file/open=/root/Juncker.jpg -file/as format=tif

___________________________________________________


Here is output of a 45 degree rotation...

mtpaint --cmd -file/open=/root/Juncker.jpg -image/free=45 -file/as format=tif

Image
Last edited by don570 on Tue 21 Jul 2015, 00:00, edited 1 time in total.

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

#201 Post by don570 »

For people using Ubuntu Lucid , Precise or Trusty Tahr

I made the debian packages again for mtpaint version 3.44.88
and posted on first post.

____________________________________

Its possible to have an interesting mirror effect with a single command.
Start with a single image called head.tif in home folder.
Combine the operations on a single line. Red is the color A. 'zad' is
name of output file. As an exercise put a gausian blur in the command
line as well.

Code: Select all

mtpaint --cmd -file/open=head.tif -image/free=45  -image/resize=mirror w=x2 -file/as=zad

Image

Image

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

#202 Post by don570 »

Here's another example of several operations in a line.
(90 degree rotation, edge effect , then convert to greyscale)

Code: Select all

-image/'Rotate Anti-Clockwise' -effects/edge=mt   -effects/greyscale
____________________________________________________

Another example:
Resize a document while the Color A is green

Code: Select all

-image/'Resize Canvas ...' w=x1.5
Image
Last edited by don570 on Sat 27 Sep 2014, 19:23, edited 1 time in total.

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

#203 Post by don570 »

inkscapelite program is useful. Here's an example....

Make a vertical border in inkscapelite, such as following...

Image

Save graphic to your Home folder /root in SVG format.
Launch terminal and write..

Code: Select all

mtpaint --cmd -file/open=border.svg -image/free=45  -image/resize=mirror w=x2 -file/as=zad
The result is a diamond shape that shows transparency.
The output file is PNG format , not SVG
because mtpaint can't save to SVG format (but can open it.)

Image

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

#204 Post by don570 »

If you don't want to use inkscapelite it is still possible to obtain an
image that shows transparency.

To explain, here is an image that has been rotated 45 degrees
and mirrored.

Code: Select all

-image/free=45  -image/resize=mirror w=x2
It shows transparency because it has already been saved to disk with
transparency number = zero (0) i.e. black is transparent color.
Red is the color A

Image

_____________________________________________________________

We can make output more transparent by making Color A = black i.e. 0
before we apply script line..

Code: Select all

-image/free=45  -image/resize=mirror w=x2
Image
______________________________________________________

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#205 Post by jamesbond »

wjaguar, thank you for your previous fix.

I've found another one. I sent an email to your sourceforge email. Let's see which one gets to you first :D If the email works next time I'll only report it from that channel.

There is an issue with freetype text option, starting from 3.44.81 (commit 42f0a48488d53a5abd8ff0df7795005cd8fac261).

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#206 Post by wjaguar »

jamesbond wrote:There is an issue with freetype text option, starting from 3.44.81
From 3.44.80, in fact. Thanks, you've uncovered a really nasty memory-corruption bug: I forgot to allocate in-tape memory for one kind of V-code widgets. Patch is attached (should be applicable to any version from 3.44.80 onwards).
Attachments
fix34488.patch.gz
(216 Bytes) Downloaded 234 times

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

#207 Post by don570 »

Here are some script lines that worked when I tested.

This divides up image into segment areas

Code: Select all


 -image/segment  threshold=7   

... and this will remove an area of solid paint and put a halo effect around it

Code: Select all

-effect/difference outer=77 inner=9

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

#208 Post by don570 »

Here is script that will process (=scale) a folder of png images
/root/my_images/*.png
The names of output files are changed with a suffix
so that they can be easily spotted.
The original images are untouched.
The script can be easily modified to change format and suffix.
Whitespace is allowed in names.

Code: Select all


#!/bin/bash

for ZAD in /root/my_images/*.png ;do
  SUFFIX=_mod
  mtpaint --cmd -file/open="$ZAD" -image/scale w=x0.5 -file/as="$ZAD"$SUFFIX 
  mv -f  "$ZAD"$SUFFIX.png   "${ZAD%.png}"$SUFFIX.png
done

Last edited by don570 on Thu 23 Jul 2015, 15:50, edited 1 time in total.

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

Version 3.44.89

#209 Post by wjaguar »

I added some more scripting capabilities to mtPaint.
Through use of invisible - yet scriptable - dialogs, select and copy/paste now can be done from script. Like this:

Code: Select all

-s/select x=10 y=10 width=63 height=63 -e/copy -e/save/1
-e/paste x=200 y=200 swap
-e/centre x=100 y=100
-s/select x0=20 y0=20 x1=50 y1=50 -s/outline -s/ellipse
Color selectors now also are scriptable. Like this:

Code: Select all

-p/edit=a colour=blue =b c=#55AAFF alpha=255 sel=85 mask=0
-p/pal =1 col=#007FFF =10 col=#7FFF00 from=1 to=10 scale=srgb
Palette indices for A and B can be selected either through the regular color chooser in Edit menu, or through invisible items in Palette menu. Like this:

Code: Select all

-e/col a=10 b=20
-p/a=10 -p/b=20
The latter two (Palette->A and Palette->B), when editing an utility channel, switch to setting channel value.

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

#210 Post by don570 »

Code: Select all

colour=blue
Americans spell the word colour as color :lol:
__________________________________________

Do you support all the SVG colors?

bsvg-0.1d.tar.gz

Code: Select all

bsvg -C [lists svg 'named colors' (1 color per line)]
bsvg firefox red pink - [prints to stdout and does not create file]

SVG 'named colors' (148):

aliceblue antiquewhite aqua aquamarine
azure beige bisque black
blanchedalmond blue blueviolet brown
burlywood cadetblue chartreuse chocolate
coral cornflowerblue cornsilk crimson
cyan darkblue darkcyan darkgoldenrod
darkgray darkgreen darkgrey darkkhaki
darkmagenta darkolivegreen darkorange darkorchid
darkred darksalmon darkseagreen darkslateblue
darkslategray darkslategrey darkturquoise darkviolet
deeppink deepskyblue dimgray dimgrey
dodgerblue firebrick floralwhite forestgreen
fuchsia gainsboro ghostwhite gold
goldenrod gray green greenyellow
grey honeydew hotpink indianred
indigo ivory khaki lavender
lavenderblush lawngreen lemonchiffon lightblue
lightcoral lightcyan lightgoldenrodyello lightgray
lightgreen lightgrey lightpink lightsalmon
lightseagreen lightskyblue lightslategray lightslategrey
lightsteelblue lightyellow lime limegreen
linen magenta maroon mediumaquamarine
mediumblue mediumorchid mediumpurple mediumseagreen
mediumslateblue mediumspringgreen mediumturquoise mediumvioletred
midnightblue mintcream mistyrose moccasin
navajowhite navy oldlace olive
olivedrab orange orangered orchid
palegoldenrod palegreen paleturquoise palevioletred
papayawhip peachpuff peru pink
plum powderblue purple red
rosybrown royalblue saddlebrown salmon
sandybrown seagreen seashell sienna
silver skyblue slateblue slategray
slategrey snow springgreen steelblue
tan teal thistle tomato
turquoise violet wheat white
whitesmoke yellow yellowgreen none 

wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

#211 Post by wjaguar »

don570 wrote:Do you support all the SVG colors?
Most likely, yes and then some - it is gdk_color_parse() doing the conversion, which in GTK+1 calls XParseColor() and in GTK+2, pango_color_parse(). Either function knows 750+ color names:
/usr/share/X11/rgb.txt
pango-X.Y.Z/pango/pango_color_table.h

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

#212 Post by don570 »

I describe how to add a line of text to the top
of a folder of images

http://www.murga-linux.com/puppy/viewto ... 333#802333

Image

_____________________________________

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

New version 3.44.89 available on first post

#213 Post by don570 »

New version 3.44.89 available on first post
________________________________________

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#214 Post by jamesbond »

wjaguar wrote:From 3.44.80, in fact. Thanks, you've uncovered a really nasty memory-corruption bug: I forgot to allocate in-tape memory for one kind of V-code widgets. Patch is attached (should be applicable to any version from 3.44.80 onwards).
Quick as always, thank you wjaguar.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

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

#215 Post by don570 »

New debian versions (Lucid,Precise and Tahr) 3.44.89

________________________________________________

When I tested these with my Wacom bamboo tablet I found an odd behaviour.
It occurs in Ubuntu and Puppy linux.

Steps to reproduce:

1) Install recent version of mtpaint.
2) Check that wacom driver is installed
3) Set up the wacom driver and make sure that pressure is working in test area.
4) Use a brush (16 pt ) in image. I see that pressure is definitely working.
5) Set down my wacom pen and start painting with my mouse or try to paint a line
with line tool using my mouse.

Painting with mouse is now impossible until the user unticks size,flow boxes
preferences > tablet

_____________________________________________

Post Reply