Recommended Posts

Distort > Lattice Transform

 

This is one of the plugins I've been wanting to do for a long time, but up until recently I didn't really have a good idea how to accomplish it. It's quite a bit more complicated math-wise than my other distortion plugins.

 

This plugin takes a triangular section of an image and then tiles it over the whole thing -- it's like a six-sided kaleidoscope except all you get are hexagons. Me being me, I also added a lot of extra features to it.

 

wPXwnoI.png

  • Radius -- Determines the size of the hexagons that are formed. This can be anything from 1% of the width to the entire width.
  • Source Center / Source Rotate -- these let you pick a different triangle essentially. The "source center" option will pan around and the "source rotate" option will rotate it.
  • Source Zoom -- Keeps the triangle settings the same but zooms out of the source image. This essentially adds more detail to the lattice pattern you've selected. With a high enough level, you can get the entire image in there.
  • Destination Zoom -- Zooms out of the resulting image as a whole.
  • Hexagonal Warping -- A neat little effect that warps the image around the hexagons which are formed. Has kind of a 3-d effect to it.
  • Preview Triangle v0 -- Lets you preview the triangle that's used in the lattice. As a version 0, this isn't perfect, but it works pretty well already. I will fix it when I fix a similar feature in my Advanced Kaleidoscope plugin.
  • Quality v0 -- a faked-out quality slider. I'll fix this when I fix it in all of my plugins. This is at least better than nothing though.

 

Let's take a look at what this plugin actually does:

 

KJn6Ib8.png

 

Here's a base image, which I made by adding the word "lattice" to a bunch of words. And recoloring it of course.

 

lncHp2F.png

 

Here's what your default settings look like. Note how you're tiling the same triangle around the whole image.

 

Ma5kanR.png

8pEc4Jn.png

Making the radius bigger or smaller respectively.

 

EclK0if.png

 

With the default settings the same, changing the Source Center and Source Rotate options. Basically this gives you a different triangle to work with.

 

s3QZQmz.png

 

With the default settings, changing the Source Zoom. Note how the overall lattice pattern is the same, but what's inside each triangle is zoomed out. Like the rest of my plugins, the image will mirror itself in  all directions so you never get random wrap lines.

 

MLIe36C.png

 

With the default settings, changing the Destination Zoom, which just zooms out of the image you've created. I have an intuition that you can mimic one of the three (radius, source zoom, destination zoom) with two of the other three, but I'm not sure which one it is. In any case, redundancy isn't a bad thing with a distortion plugin.

 

9sOeZ72.png

Here's what a hexagonal warp looks like, with a fairly high setting. These definitely give you some cool effects. Altering the radius and/or source zoom helps these effects shine as well.

 

O2DA0Mg.png

 

A hexagonal warp, with a lower-than-normal settings. As expected, the triads that were bigger are now smaller, and vice-versa.

 

vhBVMoF.png

 

Here's a hexagonal warp with a very high radius. Probably the most 3-D version of this effect, and worth sharing. Reminds me a bit of a smoother version of the Pyramid Convex setting of my Cubic Transformation plugin.

 

mxgv1gn.png

 

Here's what Preview Triangle v0 looks like. It isn't perfect, but it's enough to generally give you an idea of what will show up in the image.

 

jIoRFYB.png

 

Here's what that previewed triangle turns into.

 

Still to do

  • Fix the Preview Triangle feature. Will happen around the same time I fix it in my other plugin.
  • Fix the Quality setting. Will happen globally for all of my distortion plugins around the same time.
  • Release the codelab source code. Will happen when I release the source code for all of my plugins, which should be sooner now that I have a better understanding of C#.
  • There's definitely some untapped potential here because I'm using polar coordinates in two different places. Will be worth exploring more when I flesh out my plugin set.
  • Having destination pan and/or destination rotate options would be nice, but they're not really required.

 

Download Link

https://github.com/Xhin23/Paint.net-Plugins/blob/master/Lattice_Transform.dll

Edited by Xhin
  • Like 3

Share this post


Link to post
Share on other sites

Hi @Xhin,

 

Thank you for another delightful plugin.

 

I think users would have a better appreciation of this effect if you used a non-abstract image as the base. While colorful and beautiful, the initial images shapes are mirrored horizontally and vertically - so it's hard to see exactly where the deformations are occurring. If you used a picture of a banana (for example :) ) I'm sure we would understand the changes much more easily.

 

Just a thought....

  • Like 1

Share this post


Link to post
Share on other sites

Fixed! It definitely needed to be a fairly complicated picture -- something with too little detail like a banana wouldn't work because you just end up with an abstract yellow/black thing with most settings.

Share this post


Link to post
Share on other sites

You are killing me @Xhin!  🤣  How you keep churning out these plugins is beyond me.

 

Another excellent plugin...purrfect for making seamless textures.  Keep up the great work!! 😄

 

coke.png

 

coke_LT_01.png

 

coke_LT_02.png

  • Like 4

Share this post


Link to post
Share on other sites

This particular plugin has been in development a long long time, though I didn't write any actual code (or really know what I was doing with it) until yesterday.

 

All of my Distortion plugins use variations of a very similar codebase that I've explored a lot over the last few months. There's still a large amount of untapped potential there and I've gotten way way better at plugin development so this pace will probably continue for a while.

 

@lynxster4: you're not alone, this plugin seems particularly well-suited to transforming animals:

 

 

Edited by Xhin
  • Like 1

Share this post


Link to post
Share on other sites

My goodness @Xhin I think you are averaging a Plugin a day :)

 

This time a squirrel for a change.

 

Eyes.png

  • Like 3

Share this post


Link to post
Share on other sites

Here is my contribution using the plugin:
Color_Square_08_pattern_17.jpg

Edited by HyReZ
  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.