It is currently Sat Aug 22, 2026 9:48 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 4:53 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
I ran across this today, and His use of a mesh to display His example made me think of garagecoder, dinasset, Souphead, and Ronounours .

This looks like a good candidate for The GIMP!, and or G'MIC.

He has already implemented it in Python using PIL (Pillow) so I could use his code as a base and convert it to a plug-in, but I do not understand it, thus would not be able to intelligently make the effect alterable in any way. For example, the vertical offset of the altered edges, or the degree of curl involved. This looks similar to the page curl effect in some existing plugins/scripts, but seems at first glance to be a superior implementation.

http://benpaulthurstonblog.blogspot.com ... ormal.html

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 5:18 pm  (#2) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
If it's based on creating a map of locations to "pull" pixels from then that would translate to G'MIC well (i.e. an absolute warp). My knowledge of matrix math is close to nothing sadly but I'm willing to learn, the question is how long it would take. I'll wait and see if anyone else is going to hop in and have a go, there's little point me taking an unknown amount of time on it if it takes somebody else 30 minutes ;)

As a side note, wasn't there something like this already coded for the next version of gimp? My mind invents thing sometimes so I may have imagined it :roll:


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 5:28 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
I haven't been keeping up on next version items, so I am not sure about that. In fact, I only considered doing a 2.9 install today, and maybe a roll your own as well, still thinking on it.

I have been looking at this for some time now (around an hour) though, and I am beginning to understand it. Slightly. Still not something I could tackle, but I am working on it. Also firing a message to author asking for some help. His blog is full of in depth math articles, so I am assuming a math/computer science background. I just hope He can "dumb it down" enough for me. I'm good at math, but I don't speak the language.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 5:54 pm  (#4) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
I had a quick look at the actual program and it seems fairly trivial to do a "blind" conversion, I think it's distributing pixels from the source hence the oversampling. Ideally if it could be inverted to calculate for each output point an (x,y) source location there wouldn't be a need for oversampling.


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 6:02 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
OK, that comment is beyond me as I do not understand the "oversampling" concept. Right now I am stumbling on meanings of the variable c. The explanation led me to believe it is a point, but it has way to many coordinates for a single point ..... Need a Deep Thought here.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 6:06 pm  (#6) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
c is an array of (x,y) coordinates representing the vertices a to h (in this case hard-coded)
The oversampling is literally going over the points of the source multiple times to avoid holes in the output

Edit: I'm wrestling with the wiremap filter and some bizarre alpha channel behaviour from gimp, so I won't be working on the above any time today!


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Jan 27, 2016 8:05 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
LOL! No problem. I threw this in here for a consideration thing. I don't actually need (or really even want) this. I just thought others might be interested, so created this thread for input.

As for myself, I just want to understand it. The concept is solid, and it might have other applications. Imagine an animation made of this ...

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Thu Jan 28, 2016 4:20 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Mar 18, 2011
Posts: 283
Location: Lusaka, Zambia
I wish we can have the "Curve-bend" plug-in working like this.


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Feb 03, 2016 1:46 pm  (#9) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
jazzon wrote:
Also firing a message to author asking for some help.


@jazzon:

Did you ever hear anything back?

Turning this into a "warp" - so it can be interpolated instead of oversampled - has a lot more to do with inverse quadratics than matrices (they're only for convenience). I have a working inverse "E-bezier" warp now but the rest will likely take me months of learning, which I don't mind but it's a long wait.

Perhaps somebody good at maths can help (Souphead/David)?
Failing that I'm tempted to contact the author myself...


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Wed Feb 03, 2016 7:37 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
garagecoder
Ewwwww... thats ugly lets try this one, at least it isn't ugly!
garagecoderNo I have not goten a response yet.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sat Feb 06, 2016 5:47 pm  (#11) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Purely for demonstration there's an example under "testing -> garagecoder -> PQCT Example" due to appear within about 25 mins. Note there's no oversampling in this version, but still valid enough to show aliasing caused by distributing pixels instead of interpolating, which is my point about needing inversion.

What I now know though is the new G'MIC math parser is amazing :yes
It's fast enough to use for a type of 2D point cloud, thanks to being able to access other images within a fill (see the hacky bit at the bottom of the filter code).

This isn't optimised, literally chopped up the example so it could be speeded up still.


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sat Feb 06, 2016 6:05 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
Haven't looked yet but I'm Gonna!! :tyspin :jumpclap :yr :bowdown :geek

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 7:34 am  (#13) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16164
Garagecoder here are my results with the test.

Image

Results-

Image

_________________
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 8:21 am  (#14) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16164
Here is the effect results if i keep running the filter on a duplicate.

Image

_________________
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 2:10 pm  (#15) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
Thanks for adding an example Rod :bigthup

You'll notice holes (black pixels) in the image, oversampling would mostly solve that problem but it's not ideal. Still, it could be useful so might as well finish it off - I should be able to make it faster which will offset the penalty from oversampling.

I'm not sure what to do about controls though, sliders for that many points would be unwieldy. Interactive would be best but possibly a lot of effort!


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 3:38 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Jul 06, 2013
Posts: 2662
Location: California
When I run the filter in G'MIC, I get an error.
This is the error I get:
*** Error in ./gcd_pqct/*repeat/*local/ *** Command '-f': [_cimg_math_parser] gmic<float>::fill(): Invalid item 'q(s,t,a,b,c,d,e,f,g,h)' in expression '...,7,1)); q(s,t,a,b,c,d,e,f,g,h)= ((1/4)*b-(1/2)*s*b+(1/2)*s*s*b+(1/2)*t*t*d+(1/2)*t*d+(1/4)*e+(1/4)*g+ t*t*s*s*((1/4)*g+(1/4)*b+(1/4)*d+(1/4)*e)-(1/2)*t*t*s*g+(1/2)*s*s*g+ (1/2)*s*g-s*s*((1/4)*g+(1/4)*b+(1/4)*d+(1/4)*e)-t*t*((1/4)*g+(1/4)*b+ (1/4)*d+(1/4)*e)-(1/2)*t*t*s*s*e+(1/2)*t*s*s*e+(1/4)*t*s*f+(1/4)*t*s*s*f+ (1/4)*t*t*s*f+(1/4)*t*t*s*s*f-(1/4)*t*t*s*c-(1/4)*t*s*s*c+ (1/4)*t*t*s*s*c+(1/4)*t*s*c-(1/2)*t*t*s*s*g-(1/2)*t*e+(1/2)*t*t*e- (1/2)*t*t*s*s*b+(1/2)*t*t*s*b+(1/4)*d-(1/2)*t*s*s*d-(1/2)*t*t*s*s*d+ (1/4)*t*t*s*s*a-(1/4)*t*s*a-(1/4)*t*t*s*a+(1/4)*t*s*s*a-(1/4)*t*s*s*h+ (1/4)*t*t*s*s*h+(1/4)*t*t*s*h-(1/4)*t*s*h)...'.

Just how is the script supposed to work?


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 4:34 pm  (#17) 
Offline
GimpChat Member

Joined: Sep 24, 2012
Posts: 275
Location: Scotland
@mackenzieh

I think G'MIC 1.6.9 is required, because it uses one of the latest features in G'MIC: functions. This might change after I optimise things, but as the filter stands it's not worth worrying about (there aren't even controls yet)! Really it's just a quick test to try it out.


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 5:02 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Jul 06, 2013
Posts: 2662
Location: California
garagecoder wrote:
@mackenzieh

I think G'MIC 1.6.9 is required, because it uses one of the latest features in G'MIC: functions. This might change after I optimise things, but as the filter stands it's not worth worrying about (there aren't even controls yet)! Really it's just a quick test to try it out.


Oh, okay. I've seen the pre-release for the new version but not the actual release for it. Is it even out yet?


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Sun Feb 07, 2016 10:26 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
Yes it is out. If You are running a Ubuntu 14.04 or derivative, it requires some tweaking to install though due to new libraries needed.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: An Advanced Page Curl Effect
PostPosted: Mon Feb 08, 2016 1:42 pm  (#20) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16164
garagecoder wrote:
Thanks for adding an example Rod :bigthup

You'll notice holes (black pixels) in the image, oversampling would mostly solve that problem but it's not ideal. Still, it could be useful so might as well finish it off - I should be able to make it faster which will offset the penalty from oversampling.

I'm not sure what to do about controls though, sliders for that many points would be unwieldy. Interactive would be best but possibly a lot of effort!

You could disscuss interactive with David I know G'MIC has the capability of opening a interactive window now. :) :bigthup

_________________
Image


Top
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group