Post Reply 

Slice image into equilateral triangle pieces

Jun 6, 2014, 11:15
Post: #1
Slice image into equilateral triangle pieces
Hi all,

Would anyone know if it's possible to slice an image in to equilateral triangle pieces of the same size in one go, rather than copying a triangular part of the image one by one?

Many thanks,

Sank
Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 11:47
Post: #2
RE: Slice image into equilateral triangle pieces
Nothing that I know of. Since any image is rectangular and the triangle is part transparency it should be possible to set up some set of masks and guides to guillotine the image.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 11:56
Post: #3
RE: Slice image into equilateral triangle pieces
Thanks for your advice rich2005, I'm pretty new to Gimp, so not sure how to do that! I'll probably revert to copying individual triangle shapes from the image and pasting them into separate files.

Laddsa
Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 12:05
Post: #4
RE: Slice image into equilateral triangle pieces
Not without some script (that likely remains to be written), I'm afraid...

Btw technically you cannot really produce equilateral triangles, because the width and height should be integers and their ratio (Sqrt(3)/2) is not a rational number.

One thing that could help you right now is my path-shaped-grid script. You can use it to create a grid-shaped path, which, together with "View>Snap to active path", may ease the selection. Not much documented for the time being but discussed here (but ask further questions about in on GimpForums).

[attachment=3598]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 12:08
Post: #5
RE: Slice image into equilateral triangle pieces
out of curiosity: why do you want to do this ?

please visit Gimp-Science-Labs Blog
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 12:20
Post: #6
RE: Slice image into equilateral triangle pieces
Many thanks Ofnuts, that'll certainly make the task easier for me.

@Esper, I'm thinking about developing a mobile game to have images split into various shapes, i.e. triangles. The pieces that make the image will be rotated randomly, so the player will need to tap on them to rotate them and form the final image in a limited number of moves and time period.

Kind regards,

Laddsa
Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 13:28
Post: #7
RE: Slice image into equilateral triangle pieces
(Jun 6, 2014 12:20)laddsa Wrote:  I'm thinking about developing a mobile game

So writing the script should be a SMOP for you.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 14:15
Post: #8
RE: Slice image into equilateral triangle pieces
I've never coded in Gimp before but have done a little Python programming, but will try to learn how to code for Gimp.
Find all posts by this user
Quote this message in a reply
Jun 6, 2014, 14:36 (This post was last modified: Jun 6, 2014 14:38 by ofnuts.)
Post: #9
RE: Slice image into equilateral triangle pieces
You can code your Gimp scripts in Python, so that would just be a matter of learning the Gimp-specific API...

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 7, 2014, 07:53
Post: #10
RE: Slice image into equilateral triangle pieces
Good to know ofnuts, thanks for your advice.

Laddsa
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Image Map - update existing image w/links Norkuvich 1 190 Sep 18, 2017 08:16
Last Post: paynekj
  How to remove shaky camera ghost image? ianpwilliams 4 1,596 Aug 12, 2017 13:47
Last Post: Elizabeeth
  How to extend an Image from side to side softening the hard edge of image Flesh 2 264 Jul 21, 2017 06:21
Last Post: Flesh
  Image Quality Degradation Issue dedoubleu 2 329 Jun 7, 2017 06:37
Last Post: ythgilb
  Losing image quality Futant 2 340 Oct 10, 2014 16:07
Last Post: rich2005

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS