Gimp-Forum.net
ofn-flatten-cylinder - 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-flatten-cylinder (/Thread-ofn-flatten-cylinder)



ofn-flatten-cylinder - Ofnuts - 03-24-2023

Continuing with my obsession over cylinders in general and beverage bottles & cans in particular, may I introduce you to ofn-flatten-cylinder, that takes the image of a cylinder (or something on a cylinder):

[attachment=9596]

And flattens it:

[attachment=9597]

Of course,the pictures have to be taken carefully to be usable by the script, see the doc.

As usual the script is here.

Enjoy.


RE: ofn-flatten-cylinder - PixLab - 03-26-2023

I got this error

[attachment=9600]

And I don't get the same result as yours, I got vertical banding
EDIT: OK 16-bit is enough to not get banding > an alert would be nice, we will never recall the next month that we need to put the image in 16-32 bit Wink


RE: ofn-flatten-cylinder - Ofnuts - 03-26-2023

(03-26-2023, 06:17 AM)PixLab Wrote: I got this error

Thanks for reporting, fixed, new version on SourceForge.

(03-26-2023, 06:17 AM)PixLab Wrote: And I don't get the same result as yours, I got vertical banding
EDIT: OK 16-bit is enough to not get banding > an alert would be nice, we will never recall the next month that we need to put the image in 16-32 bit Wink

It's mentioned in the doc:

[attachment=9601]

And if you TLDR;'ed it,  and went on your merry way, you have a message:

[attachment=9602]

And Gimp isn't exactly designed to be used by visually impaired people, is it? Angel


RE: ofn-flatten-cylinder - PixLab - 03-26-2023

(03-26-2023, 10:25 AM)Ofnuts Wrote:
(03-26-2023, 06:17 AM)PixLab Wrote: I got this error

Thanks for reporting, fixed, new version on SourceForge.

(03-26-2023, 06:17 AM)PixLab Wrote: And I don't get the same result as yours, I got vertical banding
EDIT: OK 16-bit is enough to not get banding > an alert would be nice, we will never recall the next month that we need to put the image in 16-32 bit Wink

It's mentioned in the doc:
And if you TLDR;'ed it,  and went on your merry way, you have a message:

I did read the doc before, I already did forgot while testing  Big Grin

(03-26-2023, 10:25 AM)Ofnuts Wrote: And Gimp isn't exactly designed to be used by visually impaired people, is it? Angel

Lol,  Big Grin ,

You will be happy to learn that "Procedure require an existing selection" works well as well Big Grin

Anyway, I found my own way  Angel
[attachment=9603]

I'm going to play with your plugin more tomorrow, that's an interesting one Wink


RE: ofn-flatten-cylinder - Krikor - 03-27-2023

Hmmmm, am I selecting correctly?

I thought the result would be a flat label, but I'm getting one with a curvature on both the top and bottom of the label.

Used image retrieved from https://www.punch-et-cocktail.com/media/catalog/product/cache/7/image/9df78eab33525d08d6e5fb8d27136e95/i/m/image_4960.jpg

Image below scaled down to 12.5%.

[attachment=9605]  [attachment=9606] [attachment=9607]


RE: ofn-flatten-cylinder - Ofnuts - 03-27-2023

(03-27-2023, 03:54 PM)Krikor Wrote: Hmmmm, am I selecting correctly?

I thought the result would be a flat label, but I'm getting one with a curvature on both the top and bottom of the label.

Used image retrieved from https://www.punch-et-cocktail.com/media/catalog/product/cache/7/image/9df78eab33525d08d6e5fb8d27136e95/i/m/image_4960.jpg

Image below scaled down to 12.5%.

   

May I interest you in reading the "Close-up distortion" section in the doc?

Note that this remaining distortion can be worked out with the "Curve bend" tool:

[attachment=9608]

There are other things to fix.... but this picture is all ready processed quite a lot. Curvature on the label and neck show that the camera was at the height of the neck, not at the label level. This would normally translate into a narrow bottom... and the label is the same height everywhere... so the bottle was short from Mars or some post processing already happened. I also wonder if the slight curve in the right side is due to an overenthusiastic background clip, lured by a reflection.



RE: ofn-flatten-cylinder - Krikor - 03-27-2023

ofnuts,

Yep, I tried other bottle images but no luck, I got the same curvature with every one I tested the plugin on.

Thanks for the clarifications!


RE: ofn-flatten-cylinder - Ofnuts - 03-27-2023

(03-27-2023, 09:20 PM)Krikor Wrote: ofnuts,

Yep, I tried other bottle images but no luck, I got the same curvature with every one I tested the plugin on.

Thanks for the clarifications!

The docs makes it very clear that the plugin in its current version doesn't deal with the top and bottom curvatures. If you read the doc, it tells you how to take pictures that it can handle.