Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ofn-tiles & ofn-export-layers
#21
Why are there black/empty tiles? Are they black or transparent?

What kind of criterion could be used to not export a tile (considering that other users may need black/transparent tiles).
Reply
#22
Photo 
(01-17-2022, 06:27 PM)Ofnuts Wrote: Why are there black/empty tiles? Are they black or transparent?

What kind of criterion could be used to not export a tile (considering that other users may need black/transparent tiles).

Always when there is nothing in the picture, it exports black tiles. They are transparent but Windows 10 Explorer shows them as black.
I want a criterion of not exporting those black tiles when the tile in the picture is completely empty (no pixels, nothing at all in that area/tile).
This is how to replicate:
1. (Make a new image.) Make sure there is nothing in the picture and the canvas size is bigger than the something which you draw.
2. Make a new layer (make sure that it is the only layer).
3. Draw only 1 pixel on that layer anywhere. (       Attached a screenshot of it. It has 100 x 100 pixels as canvas size, only 1 layer with a red pixel on it.)
4. Export tiles, this will in result export everything including the tiles without any pixels.
     Attached a screenshot of the exported files (exported as 10 x 10 pixels), every tile is empty except that one tile with that one pixel on it. 
I don't want it to do that, Do not export tiles which are empty (no pixels), why should anybody want empty tiles?
Make it so that it only exports only the tiles with at least a pixel, please!
Reply
#23
Hi, just downloaded the ofn-tiles.py and ofn-export-layers.py

Installed as:
Home/.config/GIMP/2.10/plug-ins/ofn-export-layers.py
Home/.config/GIMP/2.10/plug-ins/ofn-tiles.py

Both are executable

When loading GIMP (installation via apt on Ubuntu 21.10), I have no additional options under Files-> as expected

It does appear that users do have these scripts operating on 2.10 (I am, using 2.10.24-2), is there anything else I should try

-- EDIT --

I have installed gimp-plugin-registry and new plugins are showing through this

I have tested the Script-fu console and basic commands are working via that

running GIMP from command line I get:

/usr/bin/env: ‘python’: No such file or directory
gimp: LibGimpBase-WARNING: gimp: gimp_wire_read(): error
/usr/bin/env: ‘python’: No such file or directory
gimp: LibGimpBase-WARNING: gimp: gimp_wire_read(): error
Plug-in "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu) is installing procedure "script-fu-bw-film" with a full menu path "<Image>/Colors/BW Film Simulation" as menu label, this deprecated and will be an error in GIMP 3.0
Plug-in "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu) is installing procedure "diana-holga2c" with a full menu path "<Image>/Filters/Artistic/diana-holga2b" as menu label, this deprecated and will be an error in GIMP 3.0
Plug-in "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu) is installing procedure "script-fu-draw-arch" with a full menu path "<Image>/FX-Foundry/Shapes/Parametric/_Arch" as menu label, this deprecated and will be an error in GIMP 3.0
Plug-in "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu) is installing procedure "script-fu-draw-box" with a full menu path "<Image>/FX-Foundry/Shapes/Parametric/Box" as menu label, this deprecated and will be an error in GIMP 3.0
Plug-in "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu) is installing procedure "script-fu-draw-ellipse" with a full menu path "<Image>/FX-Foundry/Shapes/Parametric/Ellipse" as menu label, this deprecated and will be an error in GIMP 3.0
Reply
#24
If your Gimp has Python support, there is a "Filters > Python-fu submenu".

Many recent Linux distros (any since 2020...) don't install the Python support by default (because Gimp still wants Python V2 which is deprecated. 

There are several ways around this:
  • Install the "Flatpak" version that comes with its own built-in Python v2
  • Re-instate Python support on a regular package (see this).
Reply
#25
Ofnuts - I've got the latest Flatpak version running (even trying the very latest build 2.99) - Python-Fu and Script-Fu are available in the Filters menu.But I still don't have any Plug-In options for the .py scripts...? Do you have any other ideas that would be stopping this? 


Attached Files Thumbnail(s)
       
Image(s)
   
Reply
#26
10 out of 10 for ambition but the Development Gimp 2.99 flatpak uses python3 and the plugins are for a Gimp 2.10 (flatpak) using python2

Similar for the scripts query. Just warnings about changes in the script-fu registration. The scripts will work with Gimp 2.10 but not that Gimp 2.99
Reply
#27
(03-18-2022, 04:30 PM)rich2005 Wrote: 10 out of 10 for ambition but the Development Gimp 2.99 flatpak uses python3 and the plugins are for a Gimp 2.10 (flatpak) using python2

Similar for the scripts query. Just warnings about changes in the script-fu registration. The scripts will work with Gimp 2.10 but not that Gimp 2.99

rich2005 - ok the direct leap to 2.99 was clearly a bold, but wrong move  Big Grin  - got the 2.10 Flatpak installed now and with many thanks... it is now working!
Reply
#28
Updated ofn-export-layers:
  • Support for layers groups:
    • Layers can exported to directories that follow the groups
    • Group name hierarchy can be made part of the exported file name
  • No longer bound to the default export settings: the usual export options dialog is shown (only once....) to gather the required options.

Enjoy.
Reply
#29
Hello Ofnut, just tried your ofn-tiles.py for slicing BlueMarble Texture for Celestia into little pieces.
Because Celestia needs numbering starting with zero I've selected row0 and column0.
But in ofn-tiles.py there is a typo: row0 was delared as rowO in line 81...

After changing rowO to row0: All is fine and beautiful!

Thank you!
Reply
#30
Indeed.

Congrats for debugging/fixing and thanks for reporting! Fixed version on SourceForge.
Reply


Forum Jump: