Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When scaled down edges looks jagged
#1
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?


Attached Files Image(s)
       
Reply
#2
It gets better if you pre-blur it by 1 or 2 px and then resize.

But generally speaking, a small image has less pixels for the same information, so angles and everything round will more likely look jagged.
Reply
#3
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 ( SelectFuzzy ) 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.
Reply
#4
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
Reply
#5
(03-11-2018, 12:46 AM)chrisj Wrote: Can I ask, what is the best way to change to another color other than black?

  1. Remove any selection (in particular, not alpha to selection...)(*)
  2. Alpha-lock the layer (click on the checkerboard icon on the "Lock" line at the top of the Layers list)
  3. 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.
Reply
#6
(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.

A quick search turned up these two examples:

A lighbulb vector:
https://commons.wikimedia.org/wiki/File:...bulb-1.svg

A website with lots of free icon vectors:
https://iconmonstr.com/

   

(03-10-2018, 11:12 PM)Ofnuts Wrote: 1) Select all background with the Fuzzy-select ( SelectFuzzy ) 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 ?

ofn-erase-background

get it here:
https://sourceforge.net/projects/gimp-to...s/scripts/
Reply
#7
(03-11-2018, 10:16 AM)Espermaschine Wrote:
(03-10-2018, 11:12 PM)Ofnuts Wrote: 1) Select all background with the Fuzzy-select ( SelectFuzzy ) 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 ?

ofn-erase-background

get it here:
https://sourceforge.net/projects/gimp-to...s/scripts/

Because the script doesn't tell you some important things that have to be kept in mind when working on this kind of images Smile
Reply
#8
(03-11-2018, 08:33 AM)Ofnuts Wrote:
(03-11-2018, 12:46 AM)chrisj Wrote: Can I ask, what is the best way to change to another color other than black?

  1. Remove any selection (in particular, not alpha to selection...)(*)
  2. Alpha-lock the layer (click on the checkerboard icon on the "Lock" line at the top of the Layers list)
  3. 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.


Attached Files Thumbnail(s)
   
Reply
#9
(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...
Reply
#10
(03-11-2018, 06:51 PM)chrisj Wrote: I see no 'alpha-lock'. 
Any additional direction will be appreciated.

Shown in one of your other posts

https://www.gimp-forum.net/Thread-How-to...14#pid6414
Reply


Forum Jump: