Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

pm_create_a_depthmap_image.py (Test)

Thu Mar 04, 2021 9:08 pm

Hello guys! Can anyone with Linux test this plugin I just wrote. It creates a simple Depth map and It's working in Windows though.

Instructions
1. Open the image you want to work with.
2. Create a selection of the object you want to use for 3D
3. Run the plugin and Export the image as : example_depth.jpg
you need to use the "_depth" after the name and before the extension.


Image

Re: pm_create_a_depthmap_image.py (Test)

Fri Mar 05, 2021 7:21 pm

I guess it works here in Linux. No idea what to do with the image created however......

test_depth.jpg
test_depth.jpg (156.32 KiB) Viewed 2059 times

Re: pm_create_a_depthmap_image.py (Test)

Sat Mar 13, 2021 6:13 pm

racer-x wrote:I guess it works here in Linux. No idea what to do with the image created however......

test_depth.jpg


Racer:
I have Linux Mint. Are you using 2.8 or 2.10 ?
I seem to be having either errors or not appearing at all while using 2.8
Thank you

Re: pm_create_a_depthmap_image.py (Test)

Sat Mar 13, 2021 7:12 pm

Running Linux Mint 20.1 and Gimp 2.10.22. Gimp 2.8 is very old, you really should move up to 2.10x.

Re: pm_create_a_depthmap_image.py (Test)

Sun Mar 14, 2021 4:41 am

@leftyleo

Not going to work with Gimp 2.8 - the parameters are set up for Gimp 2.10 syntax.

fails here:

Code:
  File "/media/rich/Data/gimp-2.8-port/plug-ins/pm_create_a_depthmap_image.py", line 46, in pm_create_a_depthmap_image
    grayLayer = pdb.gimp_layer_new(img, img.width, img.height, RGB, "Gray selection", 100, LAYER_MODE_NORMAL)
NameError: global name 'LAYER_MODE_NORMAL' is not defined


Not difficult to fix, however it does use the gmic plugin and the gmic plugin also has a very comprehensive depth map filter in the Stereoscopic 3D section.

Re: pm_create_a_depthmap_image.py (Test)

Sun Mar 14, 2021 7:03 am

Thank you all
I am on Mint 19.3 and just loaded up to GIMP 2.10 and gmic but still having problems..
I will go to an appropriate thread for that

This is a really interesting filter. I have some Halloween images i would try and bw/color with
the depth it might look kool
Similar to making a b/w image with only one object in color

Re: pm_create_a_depthmap_image.py (Test)

Sun Mar 14, 2021 9:06 am

rich2005 wrote:@leftyleo

Not going to work with Gimp 2.8 - the parameters are set up for Gimp 2.10 syntax.

fails here:

Code:
  File "/media/rich/Data/gimp-2.8-port/plug-ins/pm_create_a_depthmap_image.py", line 46, in pm_create_a_depthmap_image
    grayLayer = pdb.gimp_layer_new(img, img.width, img.height, RGB, "Gray selection", 100, LAYER_MODE_NORMAL)
NameError: global name 'LAYER_MODE_NORMAL' is not defined


Not difficult to fix, however it does use the gmic plugin and the gmic plugin also has a very comprehensive depth map filter in the Stereoscopic 3D section.

-----
That is correct - I am in 2.10.14 now and i got Diego's A and B working just fine
but GIMP doesnt recognize this plug-in stored in the same folder path

Re: pm_create_a_depthmap_image.py (Test)

Sun Mar 14, 2021 9:24 am

Should work: This in my (k)ubuntu 18.04 (same as Mint 19) and Gimp 2.10.14

21014.jpg
21014.jpg (142.04 KiB) Viewed 1919 times


Usual suspects:
Is the plugin executable ?
Does gimp_gmic_qt work and is it updated ?

Re: pm_create_a_depthmap_image.py (Test)

Sun Mar 14, 2021 9:50 am

rich2005 wrote:Should work: This in my (k)ubuntu 18.04 (same as Mint 19) and Gimp 2.10.14

21014.jpg


Usual suspects:
Is the plugin executable ?
Does gimp_gmic_qt work and is it updated ?


[ face palm ] -- no exec flag
thank you for pointing out the obvious for me :yes
Post a reply