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 Wed 01 Jul 2015, 11:24
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
[Tutorial] mtPaint - change hue and rescale clipboard
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message

Joined: 10 Mar 2010
Posts: 3778
Location: Ontario

PostPosted: Mon 19 Dec 2011, 18:50    Post_subject:  [Tutorial] mtPaint - change hue and rescale clipboard  

Mtpaint works with two types of images ---> indexed and RGB.
Read the beginning of the mtpaint manual for a good
explanation of these image types.

The GIF file format was designed for indexed images
(and grey scale photos as well)

The PNG file format is good for both indexed and RGB.

Here's an example of a quick rescaling of part of an image

In this example the green square is made bigger.
Note that this is an indexed image and it will remain indexed
in this first example.

The green square is cut and then transferred
to a new layer using the menu item
Edit > Paste to New Layer

Now do a rescaling
To see your transparency settings make sure you choose
View > Show Dock

Make the layer transparent (transparency color=0)
i.e. black is transparent

Use one of the numbered clipboards to move it back to
the original layer. Move the selection to where you want it
and delete the top layer to finish off the job.

...and the final result


However to change the hue (color) of the clipboard i.e. a portion of
your image, is more difficult and requires the change
of the image from indexed colors to RGB colors somewhere along
the process.

Here's the simplest method I found
using the 'Save composite layer'
Start with a red circle and a green rectangle like in example 1.

We want the rectangle to be blue and bigger.
Let us assume that the paintbucket is unavailable
so the hue change will have be done to the clipboard.

Method : Start with a red ellipse and and a green rectangle.
Repeat the steps in the previous example but
after scaling do a hue change ( by clicking on sunshine icon)
to turn the green to blue.

Make sure that the layer is transparent (transparency color=0).
Position the rectangle by changing the settings in the dock
as desired.

choose the menu item
Layers > Save composite image...

Unfortunately this turns the indexed image to a RGB image,
but this shouldn't matter to most people.
mtpaint can do a conversion back if desired.

If you start with a RGB image, the steps are simpler, i.e.
more like method 1.
The user gets a choice of scaling methods this time.
I recommend that the scaling be done with
the settings...
Nearest neighbor or
Bilinear/ Area Mapping
to avoid odd transparency effects


The above examples used rectangular selections.
Lassoed selections can have their hue changed
as well when you have a RGB image.
The color black remains solid inside the lassoed part.
(Apparently the alpha bit has been set.)
In this example I changed the color red to blue using
the upper layer as a temporary workspace,
then pasted back(using a numbered clipboard or the regular clipboard)
to the original image in the background layer.

The original image is red. I lasso it and copy to clipboard and then to
a layer. Then back to original.


Here's a more practical example of a RGB image with many colors.

Lasso the red circle and transfer it to a new layer,
Make a hue change ( to make it bluish)
Then transfer back to original image. The black inside the
blue circle has the alpha bit set obviously.

Note if you then save the image to disk with the transparency color
= 0 i.e. black is transparent, all the black including inside the blue circle will
be transparent. Here's the result...


Back to top
View user's profile Send_private_message 

Joined: 23 May 2010
Posts: 2502
Location: near here

PostPosted: Tue 20 Dec 2011, 16:10    Post_subject:  

thanks this is useful Cool
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send_private_message Visit_website 

Joined: 10 Mar 2010
Posts: 3778
Location: Ontario

PostPosted: Tue 20 Dec 2011, 18:10    Post_subject: RGB clipboard  

While making this tutorial I discovered that the clipboard wouldn't work sometimes.

Reading the mtpaint manual has provided the answer

It is possible to paste an RGB clipboard onto an RGB image and an
Indexed Palette clipboard onto an Indexed Palette or RGB image.
As the clipboard files are standard PNG files, the user can also open
them in another mtPaint process and edit them.

I think I was trying to paste a RGB clipboard into an indexed image.
This is not allowed.

Back to top
View user's profile Send_private_message 

Joined: 10 Mar 2010
Posts: 3778
Location: Ontario

PostPosted: Sat 31 Dec 2011, 12:56    Post_subject:  

I discovered that it is possible to easily remove the black paint
inside lassoed objects. The following example shows how.

On the left side of picture you see a typical paste of a lassoed object.
There is clearly black paint inside. To remove this black paint is easy.

See the right hand side of picture...

Method: First paste the lassoed object in the document.
Then choose color A = black and color B = black
Then choose from menu
Selection > Mask Colour A,B

Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0578s ][ Queries: 11 (0.0031s) ][ GZIP on ]