Gimp-Forum.net
ofn-erase-background - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: ofn-erase-background (/Thread-ofn-erase-background)

Pages: 1 2 3 4


RE: ofn-erase-background - Kevin - 10-31-2016

That's very odd.

I tried it with a 640x400 image and got the border as described by Espermaschine

If I then cropped it to 300x300, or made a new image 300x300 then I don't get a border !?

Keeping the aspect ratio:
500x312 = border
400x249 = border
390x243 = border
383x240 = no border
375x234 = no border


RE: ofn-erase-background - Ofnuts - 10-31-2016

Curiouser and curiouser. Still works OK for me, even on a 800x600 text image.

I notice that both of you are on Windows... but are you using the latest version(*)?

(*) header says: "v0.2: 2016-10-31: Replace color-to-alpha with bucket-fill in color-erase mode"


RE: ofn-erase-background - Espermaschine - 10-31-2016

Im on win7 64bit.

(10-31-2016, 02:37 PM)Ofnuts Wrote: Just in case this is the C2A plugin, I changed the code to use the bucket-fill in color-erase mode, which is strictly equivalent. Can you donwload latest (zip is 2723 bytes) and give it a shot?

I downloaded the new script version.
I get the exact same results with the console as before (progress bar stuck at approx. 95%; color gets removed anyway), but when i use fuzzy select plus script, i get the borders again (on a 640x400px canvas).


RE: ofn-erase-background - Ofnuts - 10-31-2016

Hmm. I can reproduce the problem... in a WinXP virtual box. So it looks Windows-specific. News at 10 Smile


RE: ofn-erase-background - Espermaschine - 10-31-2016

(10-31-2016, 08:10 PM)Ofnuts Wrote: News at 10 Smile

Does not run on my machine.


RE: ofn-erase-background - Ofnuts - 10-31-2016

I think I cornered it... plugin-pixelize doesn't produce the same result on Windows and Linux (both in 2.8.18).


RE: ofn-erase-background - Ofnuts - 10-31-2016

OK, need volunteers on Windows. Try this:
  • Start Gimp (need a fresh Gimp instance)
  • Create a 800x800 image
  • Add an alpha channel to the white background
  • Make a rectangle selection that covers on half of the rectangle
  • [delete]
  • You should know have a layer which is pure white on one half andfully transparent on the other
  • Using the pointer dialog you can verify that the transparent bit is still 255,255,255, only the alpha changed.
  • Remove the selection
  • Filter>Blur pixellize and use a tile as big as the image (800x800)
  • Use the pointer dialog again. The image should be a very drak gray (I get 44,44,44) with an alpha of 127.
Now, do the same thing on a small image (200x200). Your result should be half-transparent white
(255,255,255,127). If you confirm this I'll file a bug...

The script doesn't work because on "big" images (actually, big selections...), pixellize is producing the wrong color so the Color-erase which uses it doesn't work properly.


RE: ofn-erase-background - Ofnuts - 10-31-2016

OK, uploaded a "fixed" version that doesn't attempt to determine the color to remove. Instead it will use the background color as set in the Tools palette for this.


RE: ofn-erase-background - Espermaschine - 10-31-2016

(10-31-2016, 10:14 PM)Ofnuts Wrote: OK, need volunteers on Windows. Try this:

  • Start Gimp (need a fresh Gimp instance)
  • Create a 800x800 image
  • Add an alpha channel to the white background
  • Make a rectangle selection that covers on half of the rectangle
  • [delete]
  • You should know have a layer which is pure white on one half andfully transparent on the other
  • Using the pointer dialog you can verify that the transparent bit is still 255,255,255, only the alpha changed.
  • Remove the selection
  • Filter>Blur pixellize and use a tile as big as the image (800x800)
  • Use the pointer dialog again. The image should be a very drak gray (I get 44,44,44) with an alpha of 127.

Now, do the same thing on a small image (200x200). Your result should be half-transparent white
(255,255,255,127). If you confirm this I'll file a bug...

Confirmed. I followed your steps and the outcome is exactly the way you describe it.

(10-31-2016, 10:28 PM)Ofnuts Wrote: OK, uploaded a "fixed" version that doesn't attempt to determine the color to remove. Instead it will use the background color as set in the Tools palette for this.

It worked on a white BG with a black circle, but when i used a red BG with a green circle, i was left with a border again.


RE: ofn-erase-background - Ofnuts - 11-01-2016

(10-31-2016, 10:51 PM)Espermaschine Wrote:
(10-31-2016, 10:14 PM)Ofnuts Wrote: OK, need volunteers on Windows. Try this:

  • Start Gimp (need a fresh Gimp instance)
  • Create a 800x800 image
  • Add an alpha channel to the white background
  • Make a rectangle selection that covers on half of the rectangle
  • [delete]
  • You should know have a layer which is pure white on one half andfully transparent on the other
  • Using the pointer dialog you can verify that the transparent bit is still 255,255,255, only the alpha changed.
  • Remove the selection
  • Filter>Blur pixellize and use a tile as big as the image (800x800)
  • Use the pointer dialog again. The image should be a very drak gray (I get 44,44,44) with an alpha of 127.

Now, do the same thing on a small image (200x200). Your result should be half-transparent white
(255,255,255,127). If you confirm this I'll file a bug...

Confirmed. I followed your steps and the outcome is exactly the way you describe it.

(10-31-2016, 10:28 PM)Ofnuts Wrote: OK, uploaded a "fixed" version that doesn't attempt to determine the color to remove. Instead it will use the background color as set in the Tools palette for this.

It worked on a white BG with a black circle, but when i used a red BG with a green circle, i was left with a border again.

Did you set Gimp's paint background color to match (for instance using the color picker) before calling the script?

[attachment=75]