Gimp-Forum.net
unshred layer - 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: unshred layer (/Thread-unshred-layer)

Pages: 1 2


RE: unshred layer - DearDeparted - 05-01-2023

Thanks a lot for your explanation!!!

I'm now trying to find a way to quickly find out what the strip and space pixel width is.
  • gimp: I want to use the measure tool to find the pixel width (when zoomed in) for the strips and the spaces but in gimp 2.10 Is this the best way to do it, using the measure tool?
         https://docs.gimp.org/2.10/en/gimp-tool-measure.html
  • your script: is it correct that for vertical unshred ONLY pixel width matters (not height) (and the reverse for horizontal shred)? So the "strip width" in the script window, must be interpreted as strip "heigth" when doing a horizontal unshred?
  • new script: Is it possible to make a modified version of this script (that's just another script for vertical and horizontal unshredding with requirements as written here) that can unshred first vertically and then horizontally (on the result of the vertical unshred) on images that have perfect square strips (width = height in pixels) and equal spaces (in pixels) in both horizontal and vertical. I ask this because I need a way to automate the unshredding on this type of images.
Thanks for the update of the script! Heart


RE: unshred layer - Ofnuts - 05-01-2023

  • You can always start the Measure tool with Tools > Measure or Shift-M. Otherwise, in Gimp 2.10 "grouped" icons, it is in the same group as the color picker.
  • Yes, width for vertical unshredding, height for horizontal unshredding.
  • Yes, I'll look into it.



RE: unshred layer - DearDeparted - 05-01-2023

(05-01-2023, 05:36 PM)Ofnuts Wrote:
  • Yes, I'll look into it.

Thanks a lot!!! For me it doesn't matter if you use the same code (I'm not a developer so I can't read code anyway Big Grin ) as the normal script or some other way (that's easier/better). Only the result counts.

I was also wondering if you know if it's possible in GIMP to load several images (for example a whole folder of images) and then run your script (or other scripts) on each of the images, while the output of the script is saved as image too? Is there some plugin/script that can do this?
So a sort of batch processing of scripts on images?

Would you be so kind to have a look at this file I want to unshred vertically (and horizontally too, later)?

https://we.tl/t-h1tNEPHP9d

I used the measure tool and found the strips as 18px, the spaces 2px

So the calculation is 26 * 18 + 25 * 2 = 518

But for some reason the image is 530px in width?!?
So I don't understand how that's possible. There is nothing at the left or the right so where do the extra pixels come from?
I'm struggling with this now Huh


RE: unshred layer - Ofnuts - 05-03-2023

Using your image to test my script, i find it strange. The squares are blurry, it looks like it was enlarged by some non-integer scale factor... Even manually I would have trouble getting a clean output from this.


RE: unshred layer - rich2005 - 05-04-2023

Quote:..So the calculation is 26 * 18 + 25 * 2 = 518

But for some reason the image is 530px in width?!?
So I don't understand how that's possible. There is nothing at the left or the right so where do the extra pixels come from?

The left and right end columns are 19 pix wide which accounts for an extra two pixels Wink
If you set a 20x20 grid up you find the spacing is not uniform, on that basis the uncrop plugin is not going to work.

[attachment=9756]

I can get a poor result using a liquid-rescale plugin, but some preparation is required to make a suitable mask and still not 100% 

[attachment=9757]

Looks to me like the original was for pixel art, probably an indexed colour image. Maybe copied as a screenshot, hence the anti-aliasing as a RGB image


RE: unshred layer - rich2005 - 05-04-2023

Dear departed

I never seem to make things easy, using the liquid-rescale plugin is certainly a hard way. It is because I have been using Gimp for a long time. Wink

This using standard Gimp.

For your image test2.xcf

(1) You can remove any anti-aliasing with a very big value (0.99) in Layer -> Transparency -> Theshhold Alpha
(2) Apply Image -> Zealous Crop which removes unused space.

30 second example: https://i.imgur.com/QXkAgvR.mp4