Gimp-Forum.net
Uncrop plug-in - resynthesizer - 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: Uncrop plug-in - resynthesizer (/Thread-Uncrop-plug-in-resynthesizer)



Uncrop plug-in - resynthesizer - david - 07-20-2022

After using the uncrop plug-in, part of the resynthesizer suite for many years, today I discovered an error! If it used on a layer with an alpha channel it will fail.

So I have modified it to remove the alpha channel. I have also done the same for my variant - uncrop side.

I attach the two modified files. (Linux users will need to make them executable.)

[attachment=8357]


[attachment=8358]


RE: Uncrop plug-in - resynthesizer - Ofnuts - 07-20-2022

IMHO this isn't not an adequate fix. The image is uncropped OK but the alpha channel is extended with black instead of being extended with ones.


RE: Uncrop plug-in - resynthesizer - david - 07-20-2022

@Ofnuts,

Apologies, I fail to understand your reply. Could you please supply more detail.


RE: Uncrop plug-in - resynthesizer - Ofnuts - 07-20-2022

(07-20-2022, 03:58 PM)david Wrote: @Ofnuts,

Apologies, I fail to understand your reply. Could you please supply more detail.

If you look at the alpha channel of the uncropped image (for instance by adding  alayer mask), you see that that the added pixels are transparent (black rim around the mask):

[attachment=8359]

But if you make these pixels opaque, they contain the uncropped image:

[attachment=8360]

So instead of blindly deleting the alpha channel its rim could just be filled with white.

PS:  check your PMs



RE: Uncrop plug-in - resynthesizer - PixLab - 07-21-2022

(07-20-2022, 05:09 PM)Ofnuts Wrote: If you look at the alpha channel of the uncropped image (for instance by adding  alayer mask), you see that that the added pixels are transparent (black rim around the mask):
But if you make these pixels opaque, they contain the uncropped image:
So instead of blindly deleting the alpha channel its rim could just be filled with white.

I would say don't run Uncrop, just delete the mask Big Grin
More seriously, I did a try with a mask (with the script I already have) even if the image is selected (not the mask) the script work on the mask, adding more black on the mask thus more transparency.

I did a read about the author's comment in the source, and what I understood is that the plugin was never meant to work to "uncrop", for sure I might be wrong.
The author called it uncrop, but it should have been called "Enlarge", OK this very arguable

In the source
Quote:6 Increase image/canvas size and synthesize outer band from edge of original.

31 The effect for users:
32 widens the field of view, maintaining perspective of original

142 N_("Enlarge image by synthesizing a border that matches the edge, maintaining perspective. Works best for small enlargement of natural edges. Undo a Crop instead, if possible! "),

The only reference for a crop is "Undo a Crop instead, if possible!", everything else is just about enlarging an image by adding resynthesized borders.
Did I misunderstand?


RE: Uncrop plug-in - resynthesizer - Ofnuts - 07-21-2022

(07-21-2022, 01:25 AM)PixLab Wrote: I would say don't run Uncrop, just delete the mask  Big Grin

No, because if the layer has "holes", the layer is uncropped but the holes are left in. So by amending the mask you get the uncropped images with the holes, while by deleting the mask you lose the holes.


RE: Uncrop plug-in - resynthesizer - david - 07-21-2022

@Ofnuts,

Thank you for your advice and removing the modified uncrop script.

The uncrop_side program I find useful when I require to synthesize extra space in an image. When I have corrected the image offsets I will change it to fill the mask border with white.

The comments in your PM are duly noted and will be followed.


RE: Uncrop plug-in - resynthesizer - david - 07-22-2022

I have modified the script, filling the mask with white (thanks Offnuts!!!) and in now works OK when there is an alpha channel.

Here is the modified script.

[attachment=8385]