How to keep a reference to an image in PyGimp?
I have an image. And I want to have two 'views' of the image -- not in the
sense that gimp uses the word 'view', but I want an RGB version and Indexed
version. I wrote a plugin to do this; if it detects a first time run (ie. no
alternate views exist), it duplicates the image, converts it to GRAY mode,
and stores references to the alternate views on each image. Then it tries to
reconnect the displays belonging to the image to the alternate image. This
succeeds, but the original image is destroyed. Is there some way that I can
work around this, so that both images can be around?
I understand it occurs because there is no longer a reference to the image.
Is there a way to keep a reference despite the expiry of my plugin, or some
other better way to handle this problem?