Beinsezii / bsz-gimp-plugins

Plugins for GIMP 2.99.18+
MIT License
13 stars 0 forks source link

question #1

Closed germanfkzzc closed 1 year ago

germanfkzzc commented 1 year ago

I'm doing my program.I wonder how can i get the picture's data which the GIMP open with GIMP3.0

Beinsezii commented 1 year ago

I'll be honest I have no idea what you're trying to ask.

I've tested the plugins and make sure they work as intended on the GIMP 2.99.14

Is are you perhaps using a nightly or source build of GIMP?

germanfkzzc commented 1 year ago

I am developing a plugin for GIMP as my graduation project.My graduation project use K-means.So i want to know how can I get the data of an open image from GIMP, and what functions should I use.Thank you.

Beinsezii commented 1 year ago

If you're simply creating a tech demo it'd be substantially easier to just create a python venv with Pillow and numpy then decode an image off the disk. Pillow is a pretty popular library with lots of good docs so it should be easy to get started.

If you're determined to use GIMP still, you'll need to learn the plugin api through it's docs:

https://developer.gimp.org/resource/

Python-specific docs can be generated yourself using g-ir-doctool. Also there's an official python example called Exercise a goat and a python that's built into the 2.99 versions.

Of course, my whole repo is under MIT so you could also just fork it and hack pixel-math for running your means sampling instead.