It is currently Fri Apr 26, 2024 12:20 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: mosaic - challenge
PostPosted: Thu Dec 18, 2014 4:10 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Hi all G'MIC coders,

is there someone who is willing to take the challenge to:

- extract the source code from the mosaic.jar file (I know there are decompilers) posted by Lylejk
- understanding the source (i.e. being a java code "reader")
- being a G'MIC connoisseur and translate that very nice piece of code into a G'MIC filter?

It would be interesting...IMO, because the outputs are (both*) quite different from those obtainable with the current "mosaic" filter in G'MIC

edit: by "both" I mean Opus Musivum and Opus Vermiculatum

_________________
"Where am I ?"


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: mosaic - challenge
PostPosted: Thu Dec 18, 2014 5:40 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
dinasset wrote:
posted by Lylejk


URL?

Decompilers don't reinvent meaningful variable/function names... Working with decompiled code is like trying to retrieve the original Gimp layers from a PNG. But sometimes a .JAR also includes the original source.

_________________
Image


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 6:15 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Ofnuts,
have a look at post #4 of topic "Opus vermiculatum"

_________________
"Where am I ?"


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 6:39 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
No embedded source :(

_________________
Image


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 7:37 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
here is a document which -I think- describes the algorythm


Attachments:
0379_Battiato_lowres.pdf [733.32 KiB]
Downloaded 331 times

_________________
"Where am I ?"
Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 8:50 am  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Just wondering why you started with the most difficult solution if you had a description of the algorithm.. Because if you have the algorithm explained then it's just a matter of programming (not at small one, for a change :)). Otherwise it's matter of understanding someone else's vision of the algorithm, encumbered by code optimizations.

_________________
Image


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 8:57 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12518
I just wish you could get rid of the resolution restrictions withing the JAR. He did use a progra called, I believe, jgimp to compile the program. Not sure if jgimp is related to GIMP in any way. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 9:00 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Mar 15, 2014
Posts: 115
Location: Brooklyn, NY
Offnuts is right. I've reversed-engineered .jar files as well as compiled code - there's got to be a lot of money in the game to make it worthwhile, because it would certainly entail an awful lot of unfun hours. I'd rather have teeth extracted without anaesthetics.

But in this case, I think it is unnecessary. I know what this one smells like.

Image
Image

Read the context: Blur By Color

One commonly feeds the G'MIC smoothing algorithm -diffusiontensors with -structuretensors and doctors the results, i.e., judicious modification of the tensor field, then feed the concoction to -smooth. For those who prefer their whiskey with branch water, a couple of Gimp-G'MIC filters furnish a starting point:

Fire up Gimp and draw some lines (black on white, say)

Do Filters->G'MIC->Contours->Edges Offsets

Maybe, possibly Follow up with Filters->G'MIC->Contours->Gradient RGB

Now you're so damn close its on a silver platter. You need the vector transverse to the contour to break the contour runs into segments so you got your tile chips. That vector is 90 rotated degrees from the contour, which you know. Everything else is gathering rendering details from the user or pixel sampling from the underlying image to color the tile. Maybe relief_light or bump-mapping for fake shadows and highlights. Don't nobody have to reverse engineer anything.

I have clients today. They've made my phone ring all ready. Probably keep me busy over the weekend. Next week smells like the holidays to Noo Yawkers and it will settle down. I can then play with toys. Isn't that what Christmas is for?

Of course, Ronounours probably has coded this already. Probably waiting for my 200 loc so he can boil it down to - what? Ten, maybe fifteen lines. He'll do it over croissants and coffee, probably.

Stay tuned.

Garry

dinnasset - see you've posted a PDF. Haven't read it. Interesting to see if their thinking is like my thinking. But I like my thinking. Ciao.


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 9:06 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
@Garry
thanks! I wait for the ready-coded G'MIC filter, either by you or David...

@Ofnuts
I discovered the PDF later, after my initial post, just by googling...

_________________
"Where am I ?"


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 9:10 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12518
The vector direction image reminds me a lot of Naggabot's vector field rotation demo preset. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 9:26 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
just to understand what we are talking about:

mosaic by G'MIC mosaic (currently available)
Attachment:
AngelV-GMICmosaic.jpg
AngelV-GMICmosaic.jpg [ 114.07 KiB | Viewed 1662 times ]


opus-vermiculatum
Attachment:
angelV-opus-vermiculatum-FG.png
angelV-opus-vermiculatum-FG.png [ 237.89 KiB | Viewed 1662 times ]


opus-musivum
Attachment:
angelV-opus-musivum.png
angelV-opus-musivum.png [ 221.26 KiB | Viewed 1662 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 9:43 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
another document, same topic (same University)
Attachment:

_________________
"Where am I ?"


Top
 Post subject: Re: mosaic - challenge
PostPosted: Thu Dec 18, 2014 10:07 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Mar 15, 2014
Posts: 115
Location: Brooklyn, NY
@lylejk
Yep - spot on. The rabbit of this rabbit stew is a vector field. "tensor field" is a fancy way of saying "vector field" and -quiver draws nice arrows to help you visualize vector fields. So another way to state the problem is to replace all of those little quiver arrows with rectangular tiles. You don't want them to overlap, so there is a little work there, but the essential idea is if you can understand in what direction luminance is changing fastest, you can orient a bit of artwork in that direction. Naggabot's footprints are all over the place in this topic area. Take care. G.


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Mosaic

47

No new posts Attachment(s) Another Mosaic?

3

No new posts Bejeweled Mosaic.

2

No new posts Santa Mosaic

10

No new posts Mosaic Lion

5



* Login  



Powered by phpBB3 © phpBB Group