#!/usr/bin/env python
# Crop images in GIMP Python
from gimpfu import *
def crop(testfp):
pngimg = pdb.file_png_load(testfp, testfp)
pngimg.crop(100, 100, 0, 50) # Xが0、Yが50からX,Yともに100ずつ切り抜く
pdb.file_png_save_defaults(pngimg, pngimg.active_drawable, testfp, testfp)
register(
"python-fu-crop-sample",
"Crop an image",
"Crops the image.",
"programmm",
"programmm",
"2014",
"test crop",
"*",
[
(PF_STRING, "string","Image file path", None)
],
[],
crop,
menu="<Image>/Filters")
main()