Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > cf25c7a20eef99545f9f205ec4976140 > files > 29

mtpaint-handbook-3.40-3.fc15.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
<TITLE>The mtPaint Handbook - Appendix A - Miscellaneous</TITLE></HEAD><BODY BGCOLOR="white" TEXT="black">
<FONT SIZE="4">
</FONT></CENTER>

<H1>Appendix A - Miscellaneous</H1>
<A NAME="SEC1"></A>
<H2>A.1 Shortcuts</H2>
<P>
The complete list of all keyboard and mouse shortcuts in mtPaint is part of
builtin help, called up by pressing F1 or by "Help-&gt;About" menu option; see the
"Keyboard shortcuts" and "Mouse shortcuts" sections.
</P>
<P>
Additionally, several of the menu options have their keyboard shortcuts labelled
next to the option.
</P>
<P>
Besides these, there is one optional shortcut that you may find useful: "Q" key
will quit the program, if enabled through the Interface section of the
Preferences window.
</P>
<A NAME="SEC2"></A>
<H2>A.2 Supported File Types</H2>
<P>
mtPaint can handle the following file formats:
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TD><B>Format</B></TD>
<TD><B>Load</B></TD>
<TD><B>Save</B></TD>
<TD><B>Image Type</B></TD>
</TR>
<TR>
<TD>BMP</TD>
<TD>All.</TD>
<TD>Indexed palette. 24 bit RGB including alpha channel.</TD>
<TD>Any</TD>
</TR>
<TR>
<TD>GIF</TD>
<TD>All single images. Animation frames via Gifsicle.</TD>
<TD>Indexed palette including transparency index. Animations via Gifsicle.</TD>
<TD>Indexed</TD>
</TR>
<TR>
<TD>JPEG</TD>
<TD>All.</TD>
<TD>24 bit RGB.</TD>
<TD>RGB</TD>
</TR>
<TR>
<TD>JPEG2000</TD>
<TD>All.</TD>
<TD>24 bit RGB.</TD>
<TD>RGB</TD>
</TR>
<TR>
<TD>LSS16 (*.lss)</TD>
<TD>All.</TD>
<TD>Indexed palette (16 colours), 18 bits per colour (6 per RGB channel).</TD>
<TD>Indexed with 16 colours or less</TD>
</TR>
<TR>
<TD>PNG</TD>
<TD>All.</TD>
<TD>Indexed palette. 24 bit RGB. Including transparency index, alpha/selection/mask channels.</TD>
<TD>Any</TD>
</TR>
<TR>
<TD>TGA</TD>
<TD>All.</TD>
<TD>Indexed palette. 24 bit RGB. Including alpha channel.</TD>
<TD>Any</TD>
</TR>
<TR>
<TD>TIFF</TD>
<TD>All.</TD>
<TD>Indexed palette. 24 bit RGB. Including alpha channel.</TD>
<TD>Any</TD>
</TR>
<TR>
<TD>XBM</TD>
<TD>All.</TD>
<TD>2 colour indexed palette including hotspot.</TD>
<TD>Indexed with 2 colours</TD>
</TR>
<TR>
<TD>XPM</TD>
<TD>All with 4096 colours or less</TD>
<TD>Indexed palette. 24 bit RGB images with up to 4096 colours. Including transparency index and hotspot</TD>
<TD>Indexed, or RGB with 4096 colours or less</TD>
</TR>
</TABLE>

<P>
File types PNG, JPEG, JPEG2000, TIFF, and GIF are handled by external libraries:
libpng, libjpeg, libopenjpeg, libtiff, and libungif/giflib. As a result of this,
the efficiency of these file operations will depend on the version of these
libraries installed on your system. For example, libtiff is unable to read
certain old JPEG compressed TIFF files. For more information on these libraries,
consult their respective websites:
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TD>libpng</TD>
<TD><A HREF="http://www.libpng.org/pub/png/libpng.html">http://www.libpng.org/pub/png/libpng.html</A></TD>
</TR>
<TR>
<TD>libjpeg</TD>
<TD><A HREF="http://www.ijg.org/">http://www.ijg.org/</A></TD>
</TR>
<TR>
<TD>libopenjpeg</TD>
<TD><A HREF="http://www.openjpeg.org/">http://www.openjpeg.org/</A></TD>
</TR>
<TR>
<TD>libtiff</TD>
<TD><A HREF="http://www.libtiff.org/">http://www.libtiff.org/</A></TD>
</TR>
<TR>
<TD>libungif / giflib</TD>
<TD><A HREF="http://libungif.sourceforge.net/doc/">http://libungif.sourceforge.net/doc/</A></TD>
</TR>
</TABLE>

<A NAME="SEC21"></A>
<H3>A.2.1 PNG Files</H3>
<P>
When saving a PNG file you can use the preferences window or the save as dialog
to set a compression value between 1 and 9 (0 = no compression). A value of 9
compresses the most, but with the penalty that it will take more CPU usage and
time to create the file. Therefore for large images it may be sensible to use a
lower value. Faster saving may be very important for certain jobs such as saving
the frames of an animation. Here is a table comparing the time it takes me to
save a 4096x4096 photo. As a comparison the basic BMP image format is also
included:
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TD>Format</TD>
<TD>Seconds to Save</TD>
<TD>% of PNG 9</TD>
<TD>KB file size</TD>
<TD>% of PNG 9</TD>
</TR>
<TR>
<TD>BMP</TD>
<TD>1</TD>
<TD>0.6</TD>
<TD>49,236</TD>
<TD>514.7</TD>
</TR>
<TR>
<TD>PNG 1</TD>
<TD>6</TD>
<TD>3.8</TD>
<TD>13,055</TD>
<TD>136.5</TD>
</TR>
<TR>
<TD>PNG 5</TD>
<TD>10</TD>
<TD>6.4</TD>
<TD>10,656</TD>
<TD>111.4</TD>
</TR>
<TR>
<TD>PNG 9</TD>
<TD>156</TD>
<TD></TD>
<TD>9,566</TD>
<TD></TD>
</TR>
</TABLE>

<A NAME="SEC22"></A>
<H3>A.2.2 JPEG 2000 Files</H3>
<P>
The JPEG file format is currently the most commonly used file format for storing
digital photos. However, there also exists a more modern and higher quality
format called JPEG 2000 which mtPaint can use. Unfortunately this newer format
has yet to be supported by all image viewers (e.g. web browsers) and editors,
but it is still an excellent choice for storing images when quality is the most
important factor.
</P>
<P>
There are two main benefits of JPEG 2000 files (JP2) compared to a regular JPEG
file:
</P>
<UL>
<LI>For the same file size, JP2 files are normally of a higher quality.
<LI>Photos can be stored losslessly so that no information is lost.
</UL>

<A NAME="SEC221"></A>
<H4>A.2.2.1 Lossy Image Comparison - JPEG vs JP2</H4>
<P>
In this example I have used the photo image from section 6.8.3, and then saved
it as a JPEG image at level 95, and compared this to a JPEG 2000 file saved at
level 6. The JPEG file was 15,172 bytes in size, with the JP2 file being 14,438
bytes.
</P>
<P>
Pixel by pixel analysis of the difference between the original image and the
compressed files reveals the following errors:
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TD></TD>
<TD>Channel</TD>
<TD>JP2 (6)</TD>
<TD>JPEG (95)</TD>
</TR>
<TR>
<TD>Maximum Error</TD>
<TD>Red</TD>
<TD>19</TD>
<TD>84</TD>
</TR>
<TR>
<TD></TD>
<TD>Green</TD>
<TD>12</TD>
<TD>46</TD>
</TR>
<TR>
<TD></TD>
<TD>Blue</TD>
<TD>21</TD>
<TD>104</TD>
</TR>
<TR>
<TD>Average Error</TD>
<TD>Red</TD>
<TD>2.78</TD>
<TD>4.17</TD>
</TR>
<TR>
<TD></TD>
<TD>Green</TD>
<TD>1.87</TD>
<TD>2.54</TD>
</TR>
<TR>
<TD></TD>
<TD>Blue</TD>
<TD>2.62</TD>
<TD>5.15</TD>
</TR>
</TABLE>

<P>
This data was created by using the micmp program from libmtpixel, available from
the mtPaint website.
</P>
<P>
In this example, the JP2 image on the left shows far closer similarity to the
original in the centre than the JPEG on the right. The JPEG wheel arch at the
top is much more blurred and has completely lost its light rim.
</P>
<P>
<IMG ALIGN="left" SRC="../img/A.2.2a.png" BORDER="0" ALT=""> <IMG ALIGN="middle" SRC="../img/A.2.2b.png" BORDER="0" ALT=""> <IMG ALIGN="middle" SRC="../img/A.2.2c.png" BORDER="0" ALT=""> 
</P>
<P>
In this example, the roof of the red car appears to be a different shade on the
JPEG image at the bottom compared to the original in the centre, and the JP2
image at the top.
</P>
<P>
<IMG ALIGN="middle" SRC="../img/A.2.2d.png" BORDER="0" ALT="">
</P>
<P>
<IMG ALIGN="middle" SRC="../img/A.2.2e.png" BORDER="0" ALT="">
</P>
<P>
<IMG ALIGN="middle" SRC="../img/A.2.2f.png" BORDER="0" ALT="">
</P>
<A NAME="SEC222"></A>
<H4>A.2.2.2 Lossless Image Comparison - PNG vs JP2</H4>
<P>
To store a photographic image losslessly it is possible to use a compressed PNG
file. However, for most photos the JP2 format produces smaller files by about
5-25%. As an example, here are the results for the photo image in section 6.8.3:
</P>
<TABLE BORDER="1" CELLPADDING="4">
<TR>
<TD>Format</TD>
<TD>File Size (Bytes)</TD>
</TR>
<TR>
<TD>Uncompressed BMP</TD>
<TD>87,222</TD>
</TR>
<TR>
<TD>Lossless PNG (level 9)</TD>
<TD>56,297</TD>
</TR>
<TR>
<TD>Lossless JP2 (level 1)</TD>
<TD>51,731</TD>
</TR>
</TABLE>

<P>
It should be noted that the PNG file format still produces smaller files than
JP2 when compressing images with fewer colours, such as pixel art, so the
benefits are strictly limited to photographic images.
</P>
<A NAME="SEC3"></A>
<H2>A.3 Grabbing Screenshots</H2>
<P>
mtPaint can be used to grab a screenshot with either 'File-&gt;New' or using
'mtpaint -s' from the command line. If you are an IceWM user you can assign the
key 'Print Screen' to grab a screenshot by editing the file ~/.icewm/keys to
include:
</P>
<P>
key "Print" mtpaint -s
</P>
<A NAME="SEC4"></A>
<H2>A.4 Preferences</H2>
<P>
The preferences you choose in the preferences window are stored in the file
<B>.mtpaint</B>
</P>
<P>
On GNU/Linux systems, it is placed in the user's home directory,
and on Windows systems, in the user's profile directory. On Windows 9x, the
root directory of the current drive is used instead (usually, <B>C:\</B> ).
</P>
<A NAME="SEC41"></A>
<H3>A.4.1 Touch Sensitive Tablets</H3>
<P>
It is possible to use the Preferences window to enable the use of touch
sensitive tablets in mtPaint. Firstly, these devices need to be set up and
tested using your operating system drivers. Once you have done this, you can
then configure the 'Tablet' section of the Preferences window in order to affect
tool size, flow and opacity. You should enable only one of the devices listed
there, usually the one called "stylus". To test if this is working, use the
tablet to apply pressure to the test area and you will see how much pressure
has been registered.
</P>
<A NAME="SEC42"></A>
<H3>A.4.2 Localized Translations</H3>
<P>
mtPaint can be compiled to use localized translations to help non English
speaking people. If your copy of mtPaint has this feature, there will be a
section of the Preferences window called 'Language' which you can use to choose
a different language.
</P>
<P>
Each of these translations has been completed voluntarily by several mtPaint
users who wish to make its features more accessible. Some of these translations
are not complete. If you wish to complete any of these translations, or create
new translations then you are advised to visit the mtPaint website so you can
contact the maintainer in order to get instructions on doing this.
</P>
<A NAME="SEC5"></A>
<H2>A.5 Limitations</H2>
<P>
The maximum image geometry is 16384x16384. The minimum geometry is 1x1.
</P>
<P>
After loading a new palette, the canvas may contain references to colours that
are not defined. I call these orphan pixels. If you examine the image
information via the Image menu you will see how many pixels have been orphaned.
You can retrieve the pixels by expanding the palette to 256 items and then
'Palette-&gt;Remove Unused Colours'.
</P>
<P>
When using the colour A/B editor with an indexed image, if colour A = colour B,
you must edit colour B to change its RGB.
</P>
<P>
Some key combinations may not work under certain window managers, e.g.
Shift+F1-F12 or Ctrl+Mouse button.
</P>
<P>
Using the status bar items 'Cursor X,Y' and 'Pixel [ I ] {RGB}' can cause high
CPU usage on older hardware when moving the cursor vigorously.
</P>
<P>
The maximum number of layers is 100.
</P>
<P>
GTK+ Text rotation does not work in Windows ME/95.
</P>
<P>
Files with overly long pathnames cannot be displayed or opened in Windows
(if longer than 259 bytes in system's ANSI codepage encoding).
</P>
<A NAME="SEC6"></A>
<H2>A.6 Customizing mtPaint</H2>
<P>
One of the benefits of free software is that you have access to the source code
so you can customize the program to suit your needs.
</P>
<A NAME="SEC61"></A>
<H3>A.6.1 Creating Patterns</H3>
<P>
Each pattern is simply an 8x8 grid which you can edit in the source code file
./src/icons1/xbm_patterns.xbm. To use these new patterns you need to save the
new file somewhere safe and then refer to this file in the Paths section of the
Preferences window.
</P>
<A NAME="SEC62"></A>
<H3>A.6.2 Creating Brushes</H3>
<P>
If you have a particular preference for certain types of brushes, such as
circles or sprays, you can manually edit the sources to cater for your needs.
Edit memory.c and find mem_brush_list which defines all of the brushes. Each
entry is defined by a tool type, tool size and flow.
</P>
<A NAME="SEC63"></A>
<H3>A.6.3 Custom Icons</H3>
<P>
The directory ./src/icons1 contains icons and mouse pointers that are compiled
into mtPaint. It is possible to create custom icon sets to suit personal taste.
For example in order to create and build a new set try:
</P>
<UL>
<LI>cd src
<LI>cp -r icons1 icons-new
<LI>Edit the icons and pointers in icons-new as required
<LI>./configure icons-new
<LI>make
</UL>

<P>
Furthermore, icon set can be partially or wholly replaced at runtime through
GTK+ theming mechanism. For every "xpm_whatever.xpm" icon in the icon set,
there is a corresponding stock ID "mtpaint_whatever", and mtPaint will display
whatever other icon you assigned to that stock ID in a resource file, if you
refer to that file as "Default theme" in the Paths section of the Preferences
window.
</P>
<P>
Example resource file:
</P>
<HR NOSHADE SIZE=1>
<PRE>
  gtk-icon-sizes="gtk-small-toolbar=22,22"
  style "mtPaint" {
    stock["mtpaint_brcosa"] = {{ "color-brightness-contrast.png", *, *, * }}
    # Other icon definitions go here
  }
  widget_class "*" style "mtPaint" 
</PRE>
<HR NOSHADE SIZE=1>
<P>
Full documentation on relevant GTK+ resource file syntax can be found
<A HREF="http://library.gnome.org/devel/gtk/stable/gtk-Resource-Files.html">HERE</A>, under
the "Styles" heading. 
</P>
<A NAME="SEC64"></A>
<H3>A.6.4 Default Settings</H3>
<P>
mtPaint allows to override the default configuration settings, using a global
preferences file. On GNU/Linux systems, the file <B>/etc/mtpaint/mtpaintrc</B> is
used; on Windows systems, the file <B>mtpaintrc</B> need be located in
<B>etc\mtpaint</B> subdirectory under the mtPaint installation directory (i.e.,
<B>..\etc\mtpaint\mtpaintrc</B> relative to where <B>mtpaint.exe</B> file is).
</P>
<P>
Packagers and distribution builders can use this to preconfigure mtPaint in a
distribution-specific way; start mtPaint, modify whatever preferences you want,
exit mtPaint, and copy the resulting <B>~/.mtpaint</B> file to
<B>/etc/mtpaint/mtpaintrc</B>
</P>
<P>
The area where such preconfiguring is needed most, is file actions - different
distros provide different selection of preinstalled software, and some of
programs which mtPaint would run by default may be unavailable on a specific
distribution. In such cases, it's better to substitute another similar program,
or to disable the action entirely, than to confuse users by actions which do
not work.
</P>
<P>
Packager of a fully portable build can use <B>mtpaintrc</B> to relocate the user
preferences file (<B>~/.mtpaint</B>) from its default place in current user's
home directory to, say, somewhere under installation directory. To do so, add
a line "userINI = /path/filename" to <B>mtpaintrc</B>
</P>
<P>
Paths starting with "~", like "~/.mtpaint", point into the home directory. On
Windows, paths starting with a drive letter are absolute, and ones starting with
a "\" or "/" are taken to be package-relative just as "/etc/mtpaint/mtpaintrc"
itself is. No path at all (just "userINI =") means, user preferences will be
saved to <B>mtpaintrc</B> file as new default configuration.
</P>
<A NAME="SEC7"></A>
<H2>A.7 File Actions</H2>
<P>
The 'Actions' section of the File menu can be used to send the current image
file to another program, such as a web browser or email client. The
implementatation varies between GNU/Linux and Windows systems due to the
different underlying system structures. In both cases though you can configure
up to 25 items, with each having a text description (Action), a command and a
directory in which the command will be run. The first 15 items will be placed in
the menu as presets. If you don't want an item to appear as a preset then you
can place a '#' character at the beginning of the Action. You can re-order the
items in the list by dragging and dropping them in the list.
</P>
<P>
When editing the command, the current image file is represented by using '%f'
which is substituted when the command is run.
</P>
<P>
Additionally, if that another program requires, or prefers, a specific image
file format and/or pixel format, you can begin the command with "conversion
statements": "&gt;" character followed by name of what you want and a space. For a
file format, use either its file extension, or the name used for the format in
mtPaint, e.g. either "&gt;jpg" or "&gt;jpeg" for JPEG; either "&gt;jp2", "&gt;jpc", or
"&gt;jpeg2000" for JPEG2000. To do an indexed to RGB conversion, add "&gt;rgb";
otherwise, conversion will be done if the file format is RGB-only. Statements
requesting impossible things, like saving an RGB image as an XBM file, will be
ignored.
</P>
<A NAME="SEC71"></A>
<H3>A.7.1 GNU/Linux Systems</H3>
<P>
The GNU/Linux version of mtPaint comes pre-loaded with some examples of file
actions. The command is executed using the shell command sh, so in the case of
bash you can using more than one command by separating them with a semi colon.
For example this command waits for 5 seconds and then grabs a screenshot:
</P>
<P>
sleep 5; mtpaint -s &amp;
</P>
<P>
Because commands are run through the shell you can use any shell facilities like
pipes, redirection, and wildcards.
</P>
<A NAME="SEC72"></A>
<H3>A.7.2 Windows Systems</H3>
<P>
To run a program using the Windows version of mtPaint you must place the whole
path of the program in the command box. For example the following command starts
MS Paint editing the current image (in Windows XP or Window 98 respectively):
</P>
<P>
C:\WINDOWS\system32\mspaint.exe %f
</P>
<P>
C:\Program Files\Accessories\MSPAINT.EXE %f
</P>
<A NAME="SEC8"></A>
<H2>A.8 Image Loading and Saving</H2>
<P>
These functions may seem obvious, but there is more to them than meets the eye.
</P>
<P>
First, file selector supports tab completion and wildcards. For example, if you
type "p" into the entry box and press tab, only files beginning with "p" will
be displayed. If you type "dsc*.jpg" into the entry box and press tab, the file
list will only display files beginning with "dsc" and ending with ".jpg". As
you would expect the * wildcard represents any number of characters and the ?
wildcard represents exactly one character.
</P>
<P>
Then, there is undoable loading. If you enable it, loading a new image file is
treated like an ordinary image modification - you can undo it, and return to
the image you were working with before. This way, if you want to add to the
current image a piece of another, you don't need to open a separate instance of
mtPaint for that; just load the second image in undoable mode, copy the needed
part of it to clipboard, undo the load, and paste the clipboard into the first
image.
</P>
<P>
Another use of undoable loading is image comparison. You can load two (or more)
images one after another, and then quickly switch back and forth between them
using the keyboard shortcuts for undo and redo (Ctrl+Z and Ctrl+R).
</P>
<P>
As for saving, the choice of image file formats which mtPaint offers you depends
on the image you're trying to save - its type (RGB or indexed) and number of
colours in it. If it isn't possible to save the image in a given format, it is
simply not offered - which doesn't mean that the format is unavailable, but that
you need to convert the image to an acceptable type and/or number of colours.
See the "Image Type" column of the table in <A HREF="#SEC2">section A.2</A> for requirements
of specific image formats.
</P>
<HR NOSHADE SIZE=1>

<!-- html code generated by txt2tags 2.5 (http://txt2tags.sf.net) -->
<!-- cmdline: txt2tags -t html chap_00.t2t chap_01.t2t chap_02.t2t chap_03.t2t chap_04.t2t chap_05.t2t chap_06.t2t chap_07.t2t chap_08.t2t chap_09.t2t chap_A.t2t chap_B.t2t -->
</BODY></HTML>