When I load bulb--1.png(attached) on a web page it appears to have smooth edges, but it's too large.
So, after I scale image 50% and upload it (bulb--2.png)(attached)to web page the images edges don't seems smooth, more jagged in appearance. How can I reduce the size and keep the smooth edge appearance?
03-10-2018, 11:12 PM (This post was last modified: 03-10-2018, 11:13 PM by Ofnuts.)
The problem here is that the initial image is badly cut out, likely using the Fuzzy-select+Delete method[1] (cue the remaining gray pixels on the edges). If properly separated from the background direct scaling is already much better [2]:
[1] There are hours of video tutorials showing that method on Youtube. Don't trust them. To properly remove a subject with hard edges from a clean uniform background (typically, clipart, logo, text... in PNG) do the following:
1) Select all background with the Fuzzy-select ( ) tool. Shift-click any isolated areas such as loops in letters to add them
2) Select>Grow by 2px so that the selection covers the edge pixels of the subject (on a really clean image 1px is enough)
3) Colors>Color to alpha and remove the white (you can also instead bucket-fill the layer with white, if you set the bucket-fill too to Color erase mode.
Applying this method on your picture (added back a white background to remove it):
[2] Generally speaking, a preliminary blur can always be done. The idea is that details in the initial image that will disappear due to scaling (i.e., anything under 2px if you scale 50%) may have nasty side effects on the scaled image due to spatial frequency folding. Blurring the image removes them before scaling down.
Thanks for all the help. Blurring it to make it clearer seems counterintuitive, but seemed to work.
Can I ask, what is the best way to change to another color other than black?
I look forward to ant additional help, thanks
(03-11-2018, 12:46 AM)chrisj Wrote: Can I ask, what is the best way to change to another color other than black?
Remove any selection (in particular, not alpha to selection...)(*)
Alpha-lock the layer (click on the checkerboard icon on the "Lock" line at the top of the Layers list)
Bucket fill the whole layer, the alpha-lock will preserve the transparency of all layers.
(*) To be accurate you can have a selection, but all the pixels of the object (including its edge pixels) should be fully selected. For instance if you want to change the color of just the brown line, you can fuzzy-select it, and then Select>Grow by 2px to make sure to include all the edges.
03-11-2018, 10:16 AM (This post was last modified: 03-11-2018, 10:32 AM by Espermaschine.)
(03-11-2018, 12:46 AM)chrisj Wrote: Can I ask, what is the best way to change to another color other than black ?
You could also tackle the problem from another angle. All these icons were most likely made in a vector program. You can probably find a lot of them in svg format.
Changing the colour of a vector file is a lot easier, but you must use a vector program like Inkscape instead of Gimp.
It also solves your scaling problems, because a vector can be scaled indefinitely and looks better exported at small scale.
(03-10-2018, 11:12 PM)Ofnuts Wrote: 1) Select all background with the Fuzzy-select ( ) tool. Shift-click any isolated areas such as loops in letters to add them
2) Select>Grow by 2px so that the selection covers the edge pixels of the subject (on a really clean image 1px is enough)
3) Colors>Color to alpha and remove the white (you can also instead bucket-fill the layer with white, if you set the bucket-fill too to Color erase mode.
why not link to the excellent script you wrote for that method ?
(03-10-2018, 11:12 PM)Ofnuts Wrote: 1) Select all background with the Fuzzy-select ( ) tool. Shift-click any isolated areas such as loops in letters to add them
2) Select>Grow by 2px so that the selection covers the edge pixels of the subject (on a really clean image 1px is enough)
3) Colors>Color to alpha and remove the white (you can also instead bucket-fill the layer with white, if you set the bucket-fill too to Color erase mode.
why not link to the excellent script you wrote for that method ?
(03-11-2018, 12:46 AM)chrisj Wrote: Can I ask, what is the best way to change to another color other than black?
Remove any selection (in particular, not alpha to selection...)(*)
Alpha-lock the layer (click on the checkerboard icon on the "Lock" line at the top of the Layers list)
Bucket fill the whole layer, the alpha-lock will preserve the transparency of all layers.
(*) To be accurate you can have a selection, but all the pixels of the object (including its edge pixels) should be fully selected. For instance if you want to change the color of just the brown line, you can fuzzy-select it, and then Select>Grow by 2px to make sure to include all the edges.
Thanks for your reply/instructions, but, sorry, I'm not really understanding it..
If I open the bulb.png in GIMP nothing is selected yet, right? So, 'remove any selections" isn't clear to me.
Then I open up the tools drop-down, and the layers, channels, brushes... drop-down (see attached image) and I select basic image, I see no 'alpha-lock'.
Any additional direction will be appreciated.
(03-11-2018, 06:51 PM)chrisj Wrote: Then I open up the tools drop-down, and the layers, channels, brushes... drop-down (see attached image) and I select basic image, I see no 'alpha-lock'.
yeah, because you are not looking in the layers tab...