PDA

View Full Version : Photoshop - Triangular Pixelate?


LiQ
12-11-2007, 11:53 PM
Hey there!

I was curious if there is a way to achieve this triangular pixelated effect?

http://img412.imageshack.us/img412/4435/1002106copyxc5.th.jpg (http://img412.imageshack.us/my.php?image=1002106copyxc5.jpg)

To my knowledge all of the default PS filters are unable to achieve it - Stained Glass creates a polygon instead of a triangle, so it's clear to see that the mathamatical theory is there.

Does anyone know of anything? It would be greatly appreciated :)

Thanks :)

XOXO

Quadart
12-17-2007, 05:45 PM
I don’t know of any triangular image pixilation filters for PS.
You can produce a slow work-around to achieve the hexagonally based triangle field you have shown in your sample. I’ll explain it if you’re interested.


http://billmelvinart.com/client3/tripix.jpg

pgraham
12-17-2007, 09:50 PM
I'm interested

Quadart
12-18-2007, 02:48 AM
1) Make a grid of triangle subdivided hexagons in adobe Illustrator. Make each hexagon triangle a different color.

2) Select each color and place that colors batch of triangles on it’s own layer, 6 layers in all.

3) Export as layered PSD file.

4) Import in PS.

5) Place an image into the file.

6) Make a selection of each triangle group and extract that group shape from the placed image creating a new image from each of the 6 triangle groups.

7) Now for the insanely meticulous part. Select each triangle individually and Blur/Average it.

Enjoy! :eek:

The feasibility of this method is determined by level of desperation.
There’s got to be an easier way. :shrug:

http://billmelvinart.com/client3/hexgrid.jpg

Falcorr
12-18-2007, 08:23 AM
Only 6 selections to be done for that method. What is the insane part in that??

I dont get it.

You never pressed contigonous button near the magic wand .. havent you? :shrug:

If the problem is creating tile texture? You can just assign it as a pattern so you dont need to copy paste each part over and over again.

Hope that helps

Falcorr
12-18-2007, 08:30 AM
OH right.. I just realised that you wont be able to use same color for average blur. If you just regular blur with transparency lock that would do the trick.. Duplicate that layer if the blur is not solid enough.

Just ignore my posts.. SORRY! :sad:

prixatw
12-18-2007, 03:06 PM
Try the mosaic toolkit. A freeware plugin from here:
LOtis (http://www.thepluginsite.com/resources/lotis/)

Its got triangular tiles! :thumbsup:

pgraham
12-20-2007, 03:41 PM
7) Now for the insanely meticulous part. Select each triangle individually and Blur/Average it.If I ever need to do this, I'll just write a math function in Shake.

Quadart
12-20-2007, 03:59 PM
If I ever need to do this, I'll just write a math function in Shake.
I'd be interested in seeing that.

pgraham
12-20-2007, 11:24 PM
Here's a go at it. I think every other row is shifted to the left by half a triangle, but I don't want to spend any more time on it. And don't expect a step by step of this.

WarpX1 = WarpX(0, 2, (x-((x+width+(size-width%size)-y/2/sind(60))%size)-y/2/sind(60)%size+size)+size/2*((y%(2*size*sind(60))>(x%size)*2*sind(60)) + (y%(2*size*sind(60))>((width+(size-width%size)-x)%size)*2*sind(60)) - (y%(2*size*sind(60))/(size*sind(60))>1)),
(y-y%(size*sind(60))+size*sind(30)/2)+(size-size*sind(30))*((y%(2*size*sind(60))>(x%size)*2*sind(60)) + (y%(2*size*sind(60))>((width+(size-width%size)-x)%size)*2*sind(60)) - (y%(2*size*sind(60))/(size*sind(60))>1)),
0, xDelta, float size = 20);

Just copy and paste into Shake and plug something into it. There's a variable called size that changes the triangle size.

Quadart
12-21-2007, 02:18 AM
Just copy and paste into Shake and plug something into it. There's a variable called size that changes the triangle size.
Creating the grid is the easy part in Adobe illustrator using a hexagon unit of triangles. Using Transform Each, copy the hexagon offsetting it horizontally by 1 width, cmd D to repeat for row 1. Copy row 1 offsetting by 1 width horizontally and 1width x sin60° vertically. Select rows 1 and 2 and copy/past them (offsetting vertically by width x 2sin60°) using cmd D to produce the required row number. This is similar to what you have.
Or simply do it manually with Snap to Point on.

The important part is addressing the placed raster image pattern confined to each individual triangle as an averaged solid color, as in my tiled eagle head sample.

I don’t use Shake. Can Shake achieve this mosaic effect? It seems you were describing a script for just creating the triangle tessellation for Shake.

pgraham
12-21-2007, 06:28 PM
Shake's workflow is node-based, where each node represents an image or image operation. Chaining together nodes represents doing multiple operations in a certain order.

http://www.pwgraham.com/guest/triangles_shake.jpg
This is an image showing the tesselation of a color wheel. The left half is the image: the top is the original, middle is small triangles, and bottom is big triangles. The right half shows the nodes that make the image.

The script I posted yesterday is just a WarpX node with a math function in it. The WarpX node evaluates an expression at each pixel, where the value of the expression represents the location of another pixel. Shake takes the color from the pixel at the expression value and colors the current pixel that color. The expressions I wrote cut the image into triangles mathematically using regularly spaced lines in the horizontal, sloping up, and sloping down directions. Then for each pixel it chooses the color of the pixel in the middle of the nearest triangle. Not blurring the color but taking a sample and applying it across the whole triangle.

Quadart
12-22-2007, 03:31 PM
The expressions I wrote cut the image into triangles mathematically using regularly spaced lines in the horizontal, sloping up, and sloping down directions. Then for each pixel it chooses the color of the pixel in the middle of the nearest triangle. Not blurring the color but taking a sample and applying it across the whole triangle.
Thanks for the illustrated explanation.

To note, the Photoshop Blur/Average function does not simply create a blown out overall blur of a region of pixels. It accurately (in rgb space not cmyk) calculates the average color of a color varied region of selected pixels. I’m sure it’s probably a variation of the blur algorithm used in the other blur modes. Though Shake’s automated, and infinitely more practical, means of producing tessellation grids is impressive, I think PS produces a cleaner more accurate result at larger tile sizes in comparison to your large tile sample—in my initial, non-programmer opinion.

The PS sample below shows your color wheel tessellated in PS, with a triangle grid of the same size and rotation orientation as your sample. It appears the centering may be different though.

http://billmelvinart.com/client3/pstess.jpg


It’s funny, all this obsessive compulsion over something I really have no practical use for.
Who knows, tomorrow I may get a call from a client who needs a triangularly tessellated image! :eek:

—Oh yeah! What about other plugin possibilities? I can’t try prixatw’s Mosaic Toolkit recommendation, it is pc only, so it doesn’t exist in my world of os x.

LiQ
01-07-2008, 11:17 PM
First can I just say WOW!
Thank you all SOOOO much for your explanations, you guys are brilliant!

Whilst I didn't end up using any of your methods (I used my own - rotate the picture 45º, Pixelate (square) and then rotate it back - which created more of a diamond look) I will definitely look at using them in the near future! Thank you all so much! The passion for problem solving is just phenomenal. I love you all!

I shall endeavor to send you (Quadart & pgraham) a copy of the finished work (I’ve private messaged you for a postal address).

Thanks!

- Jake XOXOXO

pgraham
01-08-2008, 04:07 PM
Well now that you chose a different effect, I had to get the triangle effect to work in PS. Here's how:

- Duplicate the layer
- Skew the top layer 30 degrees
- Skew the bottom layer -30
- Scale both layers W=86.6025 H=100.0
This is the sin(60) which is the ratio of the height of the triangle to its base. It will make the mosaic the size of equilateral triangles in the end.
- Mosaic both layers
- Scale both layers W=115.47 H=100.0
This is the ratio of the base to height, restoring the original width of the image while stretching the mosaic.
- Skew the top layer -30
- Skew the bottom layer 30
- Set the top layer's opacity to 50

Basically, this makes parallelogram mosaics on each layer that are skewed in opposite directions. When the parallelograms blend they form triangles.

CGTalk Moderation
01-08-2008, 04:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.