Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
small plugin code help
#1
Hi

I have this plugin that just runs some other scripts and plugins.

I want to add the first 2 comments lines. Can somebody tell me if this is possible and fill in the required code?
The plugin works but the 2 first comment lines I don't know how to code it.

First I want to add an alpha layer to my image.

Then I want to apply "select by color" tool on a specified pixel (X and Y value of the pixel) and delete the selection from  the whole image automatically? Is this possible using code?


Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
from gimpfu import*


def test(timg, tdrawable):

#how to add alpha layer to my image?

#how to apply "select by color" tool on a specified pixel and delete the selection from  the whole image?

#determine the offset values manually
   pdb.gimp_drawable_offset(tdrawable, 0, 1, 18, -32)
   
   
#the image size is constant and 150x150 crops the border    
   pdb.gimp_image_crop(timg, 2400, 1200, 150, 150)
   
   
#guides using script-fu    
   pdb.script_fu_grid_guides(timg, 0, 150, 150, 1, 0)
   
   
#chop into 150x150 tiles    
   pdb.python_fu_ofn_guillotine_layer(timg, tdrawable)
   
   
#export all layers
   pdb.python_fu_ofn_export_layers(timg, os.path.dirname(timg.filename), "{numUp0}.png", "-", 0)
    
    
register(
       "test",
       "test",
       "test",
       "*",
       "*",
       "2024",
       "<Image>/Tools/test...",
       "*",
       [],
       [],
       test
       )

main()
Reply


Messages In This Thread
small plugin code help - by gimpygirl - 02-29-2024, 07:21 PM
RE: small plugin code help - by Ofnuts - 02-29-2024, 11:54 PM
RE: small plugin code help - by gimpygirl - 03-01-2024, 12:25 AM
RE: small plugin code help - by Ofnuts - 03-01-2024, 08:02 AM
RE: small plugin code help - by gimpygirl - 03-01-2024, 08:31 PM
RE: small plugin code help - by Ofnuts - 03-01-2024, 09:48 PM
RE: small plugin code help - by gimpygirl - 03-01-2024, 11:18 PM
RE: small plugin code help - by Ofnuts - 03-02-2024, 01:41 AM
RE: small plugin code help - by gimpygirl - 03-02-2024, 03:35 AM
RE: small plugin code help - by Ofnuts - 03-02-2024, 09:10 AM
RE: small plugin code help - by gimpygirl - 03-02-2024, 06:56 PM
RE: small plugin code help - by Ofnuts - 03-01-2024, 09:41 PM
RE: small plugin code help - by MrsP-from-C - 03-02-2024, 07:56 PM
RE: small plugin code help - by Ofnuts - 03-02-2024, 08:58 PM
RE: small plugin code help - by gimpygirl - 03-02-2024, 11:05 PM
RE: small plugin code help - by Ofnuts - 03-03-2024, 12:35 AM
RE: small plugin code help - by gimpygirl - 03-03-2024, 01:42 AM
RE: small plugin code help - by Ofnuts - 03-03-2024, 05:09 PM

Forum Jump: