It is currently Mon Apr 15, 2024 7:56 am


All times are UTC - 5 hours [ DST ]


Switch to mobile style

Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: 3D from a single image.
PostPosted: Wed Mar 02, 2011 6:50 am  (#21) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
ROD

let me be more clear:
to clear i highlighted below all the lines that should NOT be broken (no problem for the others )

#****************************************
#3D Anaglyph
#****************************************
#@gimp 3D Conversion : gimp_make3D, gimp_make3D_preview(1)
#@gimp : sep = separator()
#@gimp : note = note("Stereoscopic settings:")
#@gimp : Scene selector = choice("light motive","dark motive","landscape","center foreground","centerbackground","left foreground","right foreground","underwater")
#@gimp : Stereo base = float(50,0,200)
#@gimp : Depth control = float(0,0,100)
#@gimp : Flip left / right = bool(0)
#@gimp : Use indivial depth map = bool(0)
#@gimp : note = note("<small>To use this option your depth map must be placed below your image. Switch input layers to <i><b>Active and below</b></i>.</small>")
#@gimp : sep = separator()
#@gimp : note = note("Image adjustment:")
#@gimp : Black & White = bool (0)
#@gimp : Stereo pair = bool (0)
#@gimp : Gamma compensation = float(1,0,4)
#@gimp : Color boost = float(1,0,4)
#@gimp : Red / cyan compensation = float(0,-255,255)
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/03/01</i>.</small>")
#@gimp : note = link("Filter explained here","http://www.flickr.com/groups/gmic/discuss/72157626154386744/")


gimp_make3D :

-repeat @# -l[$>] -if {$6==0} -to_rgb[0] --gimp_do_nothing[0]
-else -luminance[0] -to_rgb[0] --gimp_do_nothing[0] -endif
-if {$5==0}
-if {$1==0} --luminance[-1]
-gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==1} --luminance[-1] -negative[-1]
-gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==2}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
-elif {$1==3}
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$3,100,50,50
-elif {$1==4}
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{100-$3},50,50
-elif {$1==5}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,1,0,$3,100
-elif {$1==6}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,0,{100-$3}
-elif {$1==7} --channels[-1] 0
-gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
-endif
-gimp_gaussian_blur[-1] 0,0,{{w+h}*0.00285},1,0,0,0

-else -rv[1,-1] -to_rgb[-1] -luminance[-1] -endif

-r[-1] 100%,100%,1,2 -s[-1] c -f[-1] 0 -n[-2] 0,$2 -a[-1,-2] c
-warp[-2] [-1],1 -rm[-1]
-if {$7==0} -s c
-if {$4==0} -rm[-1,-2,-6] -mv[-1] 0 -a[-1,-2,-3] c
-else -rm[-3,-4,-5] -a[-1,-2,-3] c -endif
-else -if {$4==1} -rv[-1,-2] -endif
-r[-1,-2] 50%,50% -a[-1,-2] x -endif
-apply_gamma $8
-gimp_mix_lab 1,0,0,$9,0,0,$8,0,0,0,2,0
-if {$7==0} -gimp_mix_rgb 1,$10,0,1,0,0,1,0,0,0,2,0 -endif -endl -done

gimp_make3D_preview :
-gimp_split_preview "-gimp_make3D ${1--2}",$-1


#************END OF FILTER***************

where is yellow highlight each line should start with #@ (or # if is a comment) if not the code will not work

i bet in your gmic file there are not broken lines:
may seems so because there is always a "view" option to display a text files and codes with "automatic carriage return" but that don't alter the original inline


if you wish to double check:

open your .gmic file in a decent text editor (notepad ++, or even gedit), check in "view" menu that "automatic inline" or "automatic return carriage" or how the heck is called is NOT enabled
and to be sure (should be no needed but will not harm) maximize at full screen the text editor window )

now check if in your gmic file what i highligheted :
each of that lines begin with"#@" (or #)


as example using the first 2 lines of the code

#@gimp 3D Conversion : gimp_make3D,
gimp_make3D_preview(1)
#@gimp : sep
= separator()

what above can not work
this below will work

#@gimp 3D Conversion : gimp_make3D, gimp_make3D_preview(1)
#@gimp : sep = separator()



In the first part of any gmic filter ( the filter gui descrition) each line has to start with #@ or, for comment line with #

if not not only the filter is broken but also all or most of the other would be unusable (as happened to lylejk )

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Last edited by PhotoComix on Wed Mar 02, 2011 7:04 am, edited 3 times in total.

Top
 Post subject: Re: 3D from a single image.
PostPosted: Wed Mar 02, 2011 6:57 am  (#22) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
sorry Rod, i corrected now the syntax and grammar horrors that made my previous message unreadable

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: 3D from a single image.
PostPosted: Wed Mar 02, 2011 7:04 am  (#23) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Rod wrote:
As long as there are no white spaces between presets they should show in GMIC and work.
Unless you do not have Graphic Novel Effects filter installed.


Here is my list in G'MIC. As you can see, I have the Graphic Novel FX installed. The only one listed that doesn't work is CHIAROSCURO.

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: 3D from a single image.
PostPosted: Wed Mar 02, 2011 7:28 am  (#24) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
PhotoComix wrote:
ROD

let me be more clear:
to clear i highlighted below all the lines that should NOT be broken (no problem for the others )

#****************************************
#3D Anaglyph
#****************************************
#@gimp 3D Conversion : gimp_make3D, gimp_make3D_preview(1)
#@gimp : sep = separator()
#@gimp : note = note("Stereoscopic settings:")
#@gimp : Scene selector = choice("light motive","dark motive","landscape","center foreground","centerbackground","left foreground","right foreground","underwater")
#@gimp : Stereo base = float(50,0,200)
#@gimp : Depth control = float(0,0,100)
#@gimp : Flip left / right = bool(0)
#@gimp : Use indivial depth map = bool(0)
#@gimp : note = note("<small>To use this option your depth map must be placed below your image. Switch input layers to <i><b>Active and below</b></i>.</small>")
#@gimp : sep = separator()
#@gimp : note = note("Image adjustment:")
#@gimp : Black & White = bool (0)
#@gimp : Stereo pair = bool (0)
#@gimp : Gamma compensation = float(1,0,4)
#@gimp : Color boost = float(1,0,4)
#@gimp : Red / cyan compensation = float(0,-255,255)
#@gimp : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical")
#@gimp : sep = separator(), note = note("<small>Author : <i>Tom Keil</i>. Last update : <i>2011/03/01</i>.</small>")
#@gimp : note = link("Filter explained here","http://www.flickr.com/groups/gmic/discuss/72157626154386744/")


gimp_make3D :

-repeat @# -l[$>] -if {$6==0} -to_rgb[0] --gimp_do_nothing[0]
-else -luminance[0] -to_rgb[0] --gimp_do_nothing[0] -endif
-if {$5==0}
-if {$1==0} --luminance[-1]
-gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==1} --luminance[-1] -negative[-1]
-gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
-elif {$1==2}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,90,0,{100-$3}
-elif {$1==3}
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,1,$3,100,50,50
-elif {$1==4}
--gimp_radial_gradient[-1] 0,0,0,255,255,255,255,255,0,0,{100-$3},50,50
-elif {$1==5}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,1,0,$3,100
-elif {$1==6}
--gimp_linear_gradient[-1] 0,0,0,255,255,255,255,255,0,0,0,{100-$3}
-elif {$1==7} --channels[-1] 0
-gimp_channel_processing[-1] 1,{$3/25},0,0,0,0,100,256,0,0,0,2,0,0
-endif
-gimp_gaussian_blur[-1] 0,0,{{w+h}*0.00285},1,0,0,0

-else -rv[1,-1] -to_rgb[-1] -luminance[-1] -endif

-r[-1] 100%,100%,1,2 -s[-1] c -f[-1] 0 -n[-2] 0,$2 -a[-1,-2] c
-warp[-2] [-1],1 -rm[-1]
-if {$7==0} -s c
-if {$4==0} -rm[-1,-2,-6] -mv[-1] 0 -a[-1,-2,-3] c
-else -rm[-3,-4,-5] -a[-1,-2,-3] c -endif
-else -if {$4==1} -rv[-1,-2] -endif
-r[-1,-2] 50%,50% -a[-1,-2] x -endif
-apply_gamma $8
-gimp_mix_lab 1,0,0,$9,0,0,$8,0,0,0,2,0
-if {$7==0} -gimp_mix_rgb 1,$10,0,1,0,0,1,0,0,0,2,0 -endif -endl -done

gimp_make3D_preview :
-gimp_split_preview "-gimp_make3D ${1--2}",$-1


#************END OF FILTER***************

where is yellow highlight each line should start with #@ (or # if is a comment) if not the code will not work

i bet in your gmic file there are not broken lines:
may seems so because there is always a "view" option to display a text files and codes with "automatic carriage return" but that don't alter the original inline


if you wish to double check:

open your .gmic file in a decent text editor (notepad ++, or even gedit), check in "view" menu that "automatic inline" or "automatic return carriage" or how the heck is called is NOT enabled
and to be sure (should be no needed but will not harm) maximize at full screen the text editor window )

now check if in your gmic file what i highligheted :
each of that lines begin with"#@" (or #)


as example using the first 2 lines of the code

#@gimp 3D Conversion : gimp_make3D,
gimp_make3D_preview(1)
#@gimp : sep
= separator()

what above can not work
this below will work

#@gimp 3D Conversion : gimp_make3D, gimp_make3D_preview(1)
#@gimp : sep = separator()



In the first part of any gmic filter ( the filter gui descrition) each line has to start with #@ or, for comment line with #

if not not only the filter is broken but also all or most of the other would be unusable (as happened to lylejk )


Yup mine are fine.Oregonian said the code worked fine for her so the code must have been copied and pasted correctly.No worries about your postings PC, i can still understand them. :)
Thanks for your help.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue May 10, 2011 7:49 pm  (#25) 
Offline
GimpChat Member

Joined: Dec 20, 2010
Posts: 174
Location: Wherever the voices in my head tell me I am.
I tried this on a few old photographs here and I was amazed at the results. I have the red/cyan 3d glasses so ended up making those type of anaglyphs. I then wondered how a simple 3d object made by MathMap might look applying a 3d Conversion setting to it:

Image

So, my next step was to ask, how about applying this to a simple rotating box made with MathMap and Filter All Layers with the grey background. I did have to apply GMIC repetitively to each separate layer (it was only 30), but that was a matter of selecting each consecutive layer and doing a Ctrl+F keyboard shortcut. I'm posting the animated GIF here:

Image

Not a fancy animation, but if you have the red/cyan glasses at home please check this out, the rotating box looks like it is literally spinning out in front of my monitor :wow


Top
 Post subject: Re: 3D from a single image.
PostPosted: Wed May 11, 2011 9:05 am  (#26) 
Offline
GimpChat Member
User avatar

Joined: Apr 18, 2011
Posts: 619
Location: New York
just put my glasses on - NICE!

_________________
Ubuntu 22.04, Kernel i686, 5.4.0-131-generic
python3 v3.10.6 ----- GIMP - ver 2.10.30


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue Jan 22, 2013 5:15 pm  (#27) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
dredging up this old thread because I want to make the stereo graph pics...not the 3-D ones that you need glasses for, but the double pictures from one picture that you can either parallel or cross-eye view. Is this gmic filter in mcgimp ... or can I put it in mcgimp? I haven't been able to find it so far.


Top
 Post subject: Re: 3D from a single image.
PostPosted: Fri Mar 29, 2013 1:01 pm  (#28) 
Offline
New Member

Joined: Mar 27, 2013
Posts: 4
I don't actually understand how I am supposed to get this working, am I supposed to create a script with it, there are no clear instructions on the installation procedure.


Top
 Post subject: Re: 3D from a single image.
PostPosted: Fri Mar 29, 2013 2:37 pm  (#29) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
H1hoshi wrote:
I don't actually understand how I am supposed to get this working, am I supposed to create a script with it, there are no clear instructions on the installation procedure.
You need to have the G'MIC plugin.
In Gimp, Filters | G'MIC | Stereoscopic 3D | 3D Conversion.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: 3D from a single image.
PostPosted: Sat Mar 30, 2013 12:33 am  (#30) 
Offline
New Member

Joined: Mar 27, 2013
Posts: 4
Okay, I have version 1.5.5.1 installed, but I don't see any 3D conversion options and it only has 251 filters available, where do I get the conversion filters?


Top
 Post subject: Re: 3D from a single image.
PostPosted: Sat Mar 30, 2013 12:58 am  (#31) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13001
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
None of the images look 3D to me. I really don't get these x-eye 3D images.
I've tried viewing them by crossing my eyes, but still nothing.
I don't see the 3D effect, the images just look like I'm viewing them with my eyes crossed, which is very uncomfortable for me. :gaah

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: 3D from a single image.
PostPosted: Sat Mar 30, 2013 4:02 am  (#32) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
LOL

_________________
Image


Top
 Post subject: Re: 3D from a single image.
PostPosted: Sat Mar 30, 2013 6:30 am  (#33) 
Offline
GimpChat Member

Joined: Feb 01, 2013
Posts: 24
Location: London, UK
H1hoshi : there should be more filters listed .. the 1.5.5.1 is quite new but should be backward compatible .. have you tried the "refresh" rotating arrows button to get the filters from the internet? .. on regular GIMP on linux these scripts should save to ~/.gmic/ and Win64 to Users\logonname\AppData\Roaming\ ..

anyway once you've got a complete list of filters the Tom Keil ones are under "Stereoscopic 3D" .. the first one "3D Conversion" has an output format side-by-side but tricky bit .. *even more than crossing your eyes the right amount* .. is making a good depth-map estimation (TK was our resident expert but has dropped of the radar recently)

2-ton : as far as I know partha's mcgimp is totally compatible but you will need the corresponding build of gmic .. from what I gather he packages them together so you don't even have to install it yourself

_________________
-- jayprich


Top
 Post subject: Re: 3D from a single image.
PostPosted: Sat Mar 30, 2013 10:19 am  (#34) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13001
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
molly wrote:
LOL


@molly,

What's so funny? :hoh

Obviously I'm not viewing the images correctly. :oops:

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: 3D from a single image.
PostPosted: Mon Apr 01, 2013 8:16 pm  (#35) 
Offline
GimpChat Member
User avatar

Joined: May 26, 2012
Posts: 342
Location: France
If you see two pics that look exactly the same then I guess you're perfectly healthy
...You can't see stereoscopics without an appropriate screen technology (hence the LOL I guess) ;)


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue Apr 02, 2013 6:43 am  (#36) 
Offline
GimpChat Member

Joined: Feb 01, 2013
Posts: 24
Location: London, UK
no anarkhya the side-by-side images will work on a normal screen but the viewer needs to make sure the scale/separation/alignment suits their eyes
personally I prefer distant parallax (looking through the screen) rather than cross-eyed version (where the images are swapped) .. but the image separation can't be too wide as ones eyes will not diverge

if you want to train yourself to view these things try and avoid distractions near the edge and start by aligning the white dots in parallax (two white dots become four if you defocus and look through the screen - press your nose against it maybe to start - then move back and try and overlap the middle two so you see three white dots)

Image

_________________
-- jayprich


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue Apr 02, 2013 8:27 am  (#37) 
Offline
GimpChat Member
User avatar

Joined: May 26, 2012
Posts: 342
Location: France
Oh all right, well, didn't know this stuff (not even sure to understand what it should do) (:


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue Apr 02, 2013 10:51 am  (#38) 
Offline
GimpChat Member
User avatar

Joined: Aug 16, 2012
Posts: 4271
Location: Göteborg, Sweden
actually some of us can't see this kind of 3d effect. some people can see only one kind of 3d effect but not others, some (like me) can't see any 3d effects at all (i'm actually lucky, once in a blue moon i experience a 3d effect for a split second or so).

_________________


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue Apr 02, 2013 12:29 pm  (#39) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13001
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
AnMal wrote:
actually some of us can't see this kind of 3d effect. some people can see only one kind of 3d effect but not others, some (like me) can't see any 3d effects at all (i'm actually lucky, once in a blue moon i experience a 3d effect for a split second or so).


@AnMal

No matter how hard I try, I just don't see the 3D effect. I must be one of those people that can't see this kind of 3D effect then. :bluesad

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: 3D from a single image.
PostPosted: Tue Apr 02, 2013 3:19 pm  (#40) 
Offline
GimpChat Member

Joined: Feb 01, 2013
Posts: 24
Location: London, UK
http://youtu.be/ycSUZ6gLNGM .. well the idea is to estimate an appropriate depthmap so even if you can't see in stereo you can just what is foreground and background , in TK's filters you can preview output type Depth Map and check the areas of image corresponding to closer items do indeed come out with lighter values .. you can use the filter he made to output small rotating clips or a wiggling animation back and forth .. this is what I did for the 1s youtube clip : you can see the depth is a bit wrong in places .. in principle you can manually edit the estimated depth-map to fix these things, I think TK's main interest was "good enough" estimation techniques to automatically convert video sources .. the great thing about 2d video is the foreground objects tend to move relative to background and occlude it and any camera motion resolves a lot of potential ambiguity .. but aligning successive frames is non-trivial .. it's interesting stuff and gmic is a good way to play with techniques : to convert a whole 2d home-movie into simulated 3d this way though you'd need a lot of patience :)

_________________
-- jayprich


Top
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Selection pasting only transparency - single layer image [Solved]

3

This topic is locked, you cannot edit posts or make further replies. Attachment(s) Interlace single letter text with a single layer? [Solved]

8

No new posts Single Line Filled Anemone.

5

No new posts Attachment(s) How to structure single color areas

3

No new posts Retexture an image with another image as "Image Pattern" Plug-in

4



* Login  



Powered by phpBB3 © phpBB Group