Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > General
User Name
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!


  Search this Thread
Old 09-04-2021, 05:30 PM   #1
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 949
Blog Entries: 4

Rep: Reputation: 91
GIMP: how to make the file transparent to 80%; except the red curve which can stay

Sorry to be here with that topic but the GIMP forum was a nightmare for having an account and asking.
The file in the attachment should be modified 80% transparent, except the red curve. How to do this in GIMP?. Any advice is welcome.
(I am using GIMP under Linux).
I try to see if this gamma function extract will pass through points I have on a JPG picture.
(mathematic visual building things.. and linux.. )
Attached Thumbnails
Click image for larger version

Name:	Bildschirmfoto vom 2021-09-04 23-55-03.png
Views:	18
Size:	26.8 KB
ID:	37130  
Old 09-04-2021, 07:29 PM   #2
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 17,656
Blog Entries: 28

Rep: Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499Reputation: 5499
I have a moderate amount of experience with the GIMP, but mostly editing and enhancing photographs.

The GIMP uses layers. If the background was seen as one layer and the line as a different layer, they could have manipulated the transparency for one layer independently of the other.

Alternatively, they could have first manipulated the transparency of the entire image, then drew or overtraced the line.

A web search for "gimp transparency" will turn up many articles and tutorials. This one looks like a good place to start:

Good luck.
Old 09-05-2021, 12:07 AM   #3
LQ Addict
Registered: Dec 2013
Posts: 17,783
Blog Entries: 11

Rep: Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383Reputation: 5383
frankbell indirectly makes an important point: if you can get to whatever generated the image, use that instead.
If that should be impossible:
  • Select the appropriate places with e.g. the Select by Color tool (Shift-o). You will have to play with the threshold to get it right.
  • Cut the selection (ctrl-x), then paste it into a new layer.
  • Activate the previous layer that should now contain the background only, and adjust transparency to your liking.
Old 09-05-2021, 01:53 AM   #4
Registered: Sep 2014
Distribution: Slackware
Posts: 893

Rep: Reputation: Disabled
Was doing this a lot, and what ondoho says is correct.

Select by color, copy selection, create new from clipboard, modify the base image, and then paste back from new image.

The thing works great for simple images like the one from OP, but whenever there's something more complex it doesn't always work properly.
For example if you were to select by color in a photo, the resulting selection will almost always have jagged edges and it'd never fit back into original image.
There's a selection (by color) tool which "paints along selection outline" where one can smooth the edge which helps most of the time, but it still leaves a clearly visible gradient along the edge.
So it's no good for photos, but really great for bitmaps.
Old 09-05-2021, 09:05 AM   #5
Senior Member
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,618

Rep: Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315

Sounds like methods described by Ondoho and Elcore are similar to the first option in the tutorial Frank linked.

Personally, I prefer masks (similar to the second method in the tutorial) - so for a task like this I would start with a Duplicate Layer and setting the bottom one to opacity 20% (i.e. 80% transparent), then with the top layer I'd use a Layer Mask or Alpha Channel to isolate the red line (there's a bunch of options - "Layer > Transparency > Color to Alpha" or "Colors > Components > Decompose" or G'MIC "Channels to Layers" or whatever).

However... if all you want to do is a quick comparison against another image, just resize the smaller image to the same size as the larger, drag the graph into the layer box, and set the Mode to something like Darken should be good enough?

Old 09-08-2021, 11:28 AM   #6
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,291
Blog Entries: 4

Rep: Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318
I would select the shape and then move it to a new "layer" which is "above" the base layer. Now you can adjust the settings of the two layers separately. In general, anything that I might wish to manipulate "together as a group" goes into its own layer.
Old 09-08-2021, 12:22 PM   #7
Registered: Jun 2007
Distribution: Knoppix
Posts: 244

Rep: Reputation: 73
A problem is that the red line in the png file isn't really sharp. It seems like a jpg image converted to png.
I tried by copying the entire image to a new Gimp layer, enhancing the color in that layer only by pushing saturation to the maximum and increasing the contrast. Then I saw that some parts of the line are magenta.
I did select the red + magenta pixels with the "Select by color tool", using the Add button for the two colors. This manner, the selection was the line pixels. After that I did invert the selection and applied the Erase tool to all, leaving the red line intact because out of the selection. Asfter a new selection inversion I applied a fresh red color to the entire selection to turn magenta pixels into red. The remaining of the layer was now empty and transparent (it seems that the alpha channel was automatically activated for that layer.
The background (original image) can be adjusted for transparency as needed, and finally one can export the result as a png file. However I'm not sure if the png conversion keeps the partial transparency.

Of course all this is needed only if one has to present/publish the image. To just observe them in transparency, it would be possible to load both images in separate layers, adjust the size/rotation to align them as needed (not very easy if an accurate work is needed) and adjust the transparency of the upper one.


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
[SOLVED] Issue using Gimp: black+transparent image transformed in [color] + transparent image dedec0 Linux - Software 12 02-09-2020 02:24 PM
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
How to implement elliptic curve cryptography(EDWARDS Curve) to my Topology surya.prakash Programming 4 07-06-2014 01:09 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 (1.3.21) and gimp-perl - need help installing gimp-perl keex Slackware 0 10-22-2003 03:54 PM > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 02:28 AM.

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