Skip to content

Instantly share code, notes, and snippets.

@Shoeboxam
Created August 4, 2016 03:03
Show Gist options
  • Save Shoeboxam/29b6c420a2e7c202ab3cab9ac230b1ae to your computer and use it in GitHub Desktop.
Save Shoeboxam/29b6c420a2e7c202ab3cab9ac230b1ae to your computer and use it in GitHub Desktop.
Gimp python-fu plugin to resize and set the image's data type.
#!/usr/bin/env python
from gimpfu import *
def stage_graphic(image, drawable):
pdb.gimp_context_set_interpolation(0)
pdb.gimp_image_scale(image, pdb.gimp_image_width(image) * 4, pdb.gimp_image_height(image) * 4)
if (pdb.gimp_image_base_type(image)):
pdb.gimp_image_convert_rgb(image)
register(
'stage-graphic',
'Prepares an image for editing',
'Prepares an image for editing',
'Shoeboxam',
'Shoeboxam',
'2016',
"Stage Graphic",
"*",
[
(PF_IMAGE, "image", "Input image", None),
(PF_DRAWABLE, "drawable", "Input drawable", None)
],
[],
stage_graphic,
menu="<Image>/Filters/Custom")
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment