LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-04-2020, 04:50 PM   #1
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,010

Rep: Reputation: 34
Question Issue using Gimp: black+transparent image transformed in [color] + transparent image


I saved the 800x618 px PNG image https://openclipart.org/image/800px/...1540361873.png, displayed in https://openclipart.org/detail/30883...ledge-transfer .

It is an image with two basic kinds of points: transparent and black. But the limits also contain varying amounts of transparency, so the several curves that this image has look perfectly smooth. Good.

Now, i want to make this image to be (for example) purple and transparent, instead of black and transparent. I thought that using Gimp's menu "colors > hue-saturation" would be just what i needed, and that it would be simply scrolling the color choosing controls. But when i click on that menu, i receive this error:

"hue-saturation operates only on RGB color layers"

The same error happens when i use menu "tools > color tools > hue-saturation".

I tried to search for this error, but i could not a good result, in the few i got for this search. Do you know what i should do?
 
Old 02-04-2020, 04:55 PM   #2
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,561

Rep: Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645
Without firing up gimp, my guess would be that the image is not an RBG image.
Have you tried converting (a copy of it) to RBG?
 
Old 02-04-2020, 07:10 PM   #3
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,010

Original Poster
Rep: Reputation: 34
I tried a few things with the image only layer in Gimp, tried to create a new layer, expecting it would be an RGB one, but nothing worked. The way you said it went to a path i had not thought about trying. And it is strange to me: "RGB image". Anyway, i searched for that:

https://duckduckgo.com/html?q=gimp%2...age%20to%20RGB

The text of these results were provoking, and some of them mentioned the menu item "Image > Mode", which i never used before. Some went a bit far, and mentioned items inside this menu. One of them is RGB!

The image mode was grayscale. After changing it to RGB, the path to change black to other color was not what i thought initially.

What i did, in the end, was:

1. *Selected by color* the black part of the image, using a high tolerance of 201 with the tool

2. Selected the desired new color for the image as the Gimp's foreground color

3. Filled the selected area with the (chosen) foreground color (function found in "Edit" menu)

This is bad because it does not preserve the pure color to full transparency smooth change that existed. Anyway, it was enough, for now. I will not close this thread now just for this "detail" i was unable to make.
 
Old 02-04-2020, 07:10 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,857

Rep: Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120
yep, switch it to colors,
Image->mode->RGB

Pick your color, pick the paint bucket, then pour the color into the heads, and dots. export to format of your liking.
Attached Thumbnails
Click image for larger version

Name:	crazycrazytwotone.png
Views:	2
Size:	17.5 KB
ID:	32451  

Last edited by BW-userx; 02-04-2020 at 07:25 PM.
 
Old 02-08-2020, 04:04 PM   #5
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,010

Original Poster
Rep: Reputation: 34
Thumbs down

Quote:
Originally Posted by BW-userx View Post
yep, switch it to colors,
Image->mode->RGB

Pick your color, pick the paint bucket, then pour the color into the heads, and dots. export to format of your liking.
There are details where your steps will not work. The image is not made of 2 colors only. It is made of several shades of gray, until it is completely black. To use the paint bucket and transform each pixel with these shades is impossible, i think. The paint bucket will only make pixels with 100% pure color, the one we chose. It has a limit for how big the painted area will be. But this limit will not be smooth.

(hard to describe by words) If we choose a small limit, gray pixels will still exist. If it is bigger, less gray pixels will remain, but *all of them* will have pure colors, the color we chose to paint. And if the bucket limit is too big, it will paint the whole picture, at some point.
 
Old 02-08-2020, 04:19 PM   #6
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,010

Original Poster
Rep: Reputation: 34
Wink Not really a solution, but...

As I said in #3, there is a small detail that changes the picture a bit. But today a possible solution appeared here. It will make a PNG image with the pixels having the right shades of any basic color we choose to the picture.

The solution is: do it in the SVG file, in Inkscape! After changing the color (at least) there, we export it to PNG (since the PNG i used is made by this, but the openclipart.org did it). Any other SVG editor should work, of course. I did not test, will not test. If anyone wants to comment about this idea, or detail it, please do.

Else, see you around (:
 
Old 02-08-2020, 04:43 PM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,857

Rep: Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120
have you tired selecting copy and paste as new layer onto a newly created transparent background, if all you're looking to do it change the black into green with the background being transparent. that is simple enough.
 
Old 02-09-2020, 01:07 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,722
Blog Entries: 9

Rep: Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791Reputation: 3791
Quote:
Originally Posted by dedec0 View Post
There are details where your steps will not work. The image is not made of 2 colors only. It is made of several shades of gray, until it is completely black. To use the paint bucket and transform each pixel with these shades is impossible, i think. The paint bucket will only make pixels with 100% pure color, the one we chose. It has a limit for how big the painted area will be. But this limit will not be smooth.

(hard to describe by words) If we choose a small limit, gray pixels will still exist. If it is bigger, less gray pixels will remain, but *all of them* will have pure colors, the color we chose to paint. And if the bucket limit is too big, it will paint the whole picture, at some point.
Even so, Gimp has ways to deal with it.
But...
Quote:
Originally Posted by dedec0 View Post
The solution is: do it in the SVG file, in Inkscape!
This is by far the most elegant solution!
 
Old 02-09-2020, 04:45 AM   #9
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,010

Original Poster
Rep: Reputation: 34
Arrow

Quote:
Originally Posted by ondoho View Post
Even so, Gimp has ways to deal with it.
I am lefting this thread open for someone saying those ways. I do not know much about Gimp, but i will be interested in learning more.
 
Old 02-09-2020, 11:21 AM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,863

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
After using RGB mode as you did in post #3, did you also try to Colors -> Colorize? I was able to colorize it with this method. You will have to choose a Lightness value > 0, e.g., I used 50 in the screenshot. Then you can change the Hue setting.
Attached Thumbnails
Click image for larger version

Name:	screenshot_colors_colorizep.png
Views:	8
Size:	171.1 KB
ID:	32503  
 
1 members found this post helpful.
Old 02-09-2020, 12:41 PM   #11
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,010

Original Poster
Rep: Reputation: 34
Talking

Quote:
Originally Posted by crts View Post
After using RGB mode as you did in post #3, did you also try to Colors -> Colorize? I was able to colorize it with this method. You will have to choose a Lightness value > 0, e.g., I used 50 in the screenshot. Then you can change the Hue setting.
Perfect! I imagine this is the best result we can achieve with Gimp. ^,^

To store things better, i uploaded your screenshot to imgbox, in case you need the space in LQ in the future.

And i also made one image with parts of 2 screenshots i have:

1. the original image with enough zoom, so we see the black gradient pixels it has;

2. the changed image, with the colorize settings shown and the result for them.

- - - - - - - - - - -

Side question: which window manager you use? FVWM? Your screenshot remembers me of when i used it. I configured darker colors for everything, not only for its own window parts. I visited FVWM's site a few months ago. It seemed almost abandoned, in the end. Sad - i thought.
 
Old 02-09-2020, 01:58 PM   #12
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,863

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Yes, it is FVWM2. It will not be developed any more but FVWM3 is still active according to their github repo.
 
Old 02-09-2020, 02:24 PM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,857

Rep: Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120
they've got a 3? too bad they do not have screenshots of it.
 
  


Reply

Tags
gimp transparency


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SNAP my ssss this installed gimp and gimp no want to work right 2.10 gimp. BW-userx Linux - Software 1 12-07-2018 01:37 PM
LXer: GIMP Painter And GIMP Paint Studio Transform GIMP Into The Ultimate Painting Tool LXer Syndicated Linux News 0 02-08-2011 05:40 PM
gimp will not color on transparent gif nephish Linux - Software 2 08-27-2008 12:48 AM
REQ: Gimp plugin fo automatic color correction and color masks Rick069 Linux - Software 1 04-15-2007 03:10 PM
gimp (1.3.21) and gimp-perl - need help installing gimp-perl keex Slackware 0 10-22-2003 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration