Updated the top post and the thread title to include ofn-export-layers.
Thread Rating:
ofn-tiles & ofn-export-layers
|
Hi, I placed the .py file in the plugin folder under Appdata > Roaming > GIMP >2.~. But I do not see any option under " Layer > Save as Tiles "
Edit : checked the HTML file, it has instructions.
12-07-2021, 01:06 PM
@Ofnuts The first post said
Quote:ofn-tiles in accessed via Layer>Save as tiles.
12-15-2021, 04:34 AM
1) Thanks for the script.
2) For my own uses I made a modification that may help someone else. (adding detailed description to aid in search indexing, this is a sorta niche case) Details: I'm wanting to slice a bunch of images into tiles for a Minecraft repeating texture (connected texture, method=repeat). The format for this is numbering each tile starting at 0 and incrementing (height and width of the completed tile are defined in the .properties file) with nothing else in the filename. Ie, if slicing an image into 4 tiles (2 x ), the files would be: 0.png, 1.png, 2.png, 3.png To do that I added a formatValue for "current". In the version of 'ofn-tiles' dated 2020-08-16, go to line 88, which (in case future updates change the line this occurs on) will look like: Code: formatValues['tileRC1']=tileRC+1, Add a new line below it that says: Code: formatValues['current']=((row*columns)+(column+1))-1 Then when exporting tiles, change the filename to be only: {current}.png This addition won't change any other functionality of the script. (first time messing with Python, so if I've goofed post a correction ... Note: if you're here for this and you're ONLY going to be using the plugin for this purposed, you can also change: Code: (PF_STRING, 'namePattern', 'Tile name', '{imageName}-{column1:02d}-{row1:02d}.png'), to: Code: # (PF_STRING, 'namePattern', 'Tile name', '{imageName}-{column1:02d}-{row1:02d}.png'), and it will default to this as the export filename (for the rows and columns method, changing the width and height default is equally as easy).
12-15-2021, 07:43 AM
(12-15-2021, 04:34 AM)jahf Wrote: 1) Thanks for the script. No need to change the script, this is what the tileRC0, tileCR0,tileRC1, tileCR1 are supposed to do: Quote: tileCR0, tileCR1, tileRC0, tileRC1: the sequence number of the tile. The tileRC value increments the columns before the rows, and the tileCR values increments the rows before the columns. So starting with this: For tileRC0 you get this: Which is what you want, or am I missing something?
12-15-2021, 01:27 PM
(12-15-2021, 07:43 AM)Ofnuts Wrote:Quote: tileCR0, tileCR1, tileRC0, tileRC1: the sequence number of the tile. The tileRC value increments the columns before the rows, and the tileCR values increments the rows before the columns. I'm sorry if I'm wrong, my English is admittedly deplorable, but wouldn't it be the other way around? The tileRC value increments the rows before the columns, and the tileCR values increments the columns before the rows. ?!
.....
Samj Portable - Gimp 2.10.28 - Win-10 /64. (12-15-2021, 01:27 PM)Krikor Wrote:(12-15-2021, 07:43 AM)Ofnuts Wrote:Quote: tileCR0, tileCR1, tileRC0, tileRC1: the sequence number of the tile. The tileRC value increments the columns before the rows, and the tileCR values increments the rows before the columns. No, that's the way it is. The coordinates of the tiles in a X,Y referential is really (column,row). So tileRC, to ouput the images row by row, goes (1, 1), (2, 1), (1, 2), (2, 2) and this increments the columns before the rows:
12-16-2021, 06:00 PM
It took me a while to understand this.
The explanation given in the previous post was excellent and clarified my doubts! "The coordinates of the tiles in a referential X,Y is really (column,row). So tileRC, to output the images row by row, goes (1, 1), (2, 1), (1, 2), (2, 2) and this increments the columns before the rows" My question was about: "the sequence number of the tile. The tileRC value increments the columns before the rows, and the tileCR value increments the rows before the columns." Why did I think the sequence was reversed? Because the way I was looking at the process was different! In the case of TileRC, I thought that the tiles from the first row were selected first, then those from the second row, etc. until the last row. In the example in the image below, the order obtained from the Tiles is: a1, b1, c1,d1 and e1 (first row), then a2, b2, ...,e2 (second row), etc. In the case of TileCR, as shown in the image below, first the tiles in the first column were selected, then those in the second column, etc. a1, a2, a3, a4 (first column); b1, b2, b3, b4 (second column), etc. Hence my doubt. Perhaps a matter of point of view (not regarding the process itself, as explained in the previous post): In the TileRC of the image below, to output the images row by row, goes: 01- (1, 1), (2, 1), (1, 2), (2, 2) and this increments the columns before the rows. 02- As I see it: Take everything on the first line, then everything on the second line, etc. For TileCR, goes: 01- (1,1), (1,2), 2,1), (2,2) and this increments the rows before the columns. 02- As I see it: Take the entire first column, then the second column, etc. A half full glass of water, was it half full or half empty?
.....
Samj Portable - Gimp 2.10.28 - Win-10 /64.
01-16-2022, 02:20 PM
(This post was last modified: 01-16-2022, 02:27 PM by tilesUser.
Edit Reason: added picture as a file (Added), it was not shown for some reason
)
(08-09-2017, 09:15 PM)Ofnuts Wrote: The place to discuss ofn-tiles (still fairly experimental as this thread is started) and ofn-export-layers When I use ofn-tiles it exports empty tiles as black tiles and I do not want that. I want it to export all the tiles which have something drawn on them, please help me. I do not want empty blank black tiles, I want only the ones which have something on them. I do not know how to write a script to check if the tile has something on it and then export. Can someone show me how to export only the tiles which are not empty with ofn-tiles? |
« Next Oldest | Next Newest »
|