<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi!<div class=""><br class=""></div><div class="">I am planning to resume the work on the PhotoFlow Krita plug-in, with the goal of duplicating the functionalities already provided by the equivalent GIMP plug-in.</div><div class=""><br class=""></div><div class="">Here is a short description of what I am aiming for:</div><div class=""><br class=""></div><div class="">- a file loader plug-in that allows to open RAW images, process them in photoflow and then send the result to Krita. This is already existing and available for testing here: <a href="https://github.com/aferrero2707/krita" class="">https://github.com/aferrero2707/krita</a></div><div class="">- a filter plug-in that allows to send the contents of a Krita layer to PhotoFlow, do some editing, and then send the result back to Krita by either replacing the layer or adding a new one. This is my next goal…</div><div class=""><br class=""></div><div class="">PhotoFlow is a non-destructive editor, and the editing configuration can be saved in special XML files along with the original pixel data. This is used in GIMP to provide a non-destructive filter plug-in, which works in the following way:</div><div class=""><br class=""></div><div class="">- the first time a layer is opened with the PhotoFlow filter, the image data is simply saved into a floating-point TIFF file that gets opened by PhotoFlow</div><div class="">- after the editing is finished in PhotoFlow, the result is saved back as a floating-point TIFF, together with the XML configuration of the editing that has been performed</div><div class="">- the output TIFF data is loaded as a new layer, and the XML configuration data is associated to this new layer as meta-data</div><div class=""><br class=""></div><div class="">At this point we have the new layer (B) with the output of photoflow sitting above the original layer (A). If the user runs again the photoflow filter plug-in on layer B, the plug-in will detect the presence of the XML meta-data, and will give the option to resume the stored edit instead of starting a new one. In this case, the contents of layer A as well as the XML configuration will be sent to the plug-in, and all the editing steps needed to go from layer A to layer B will be restored, ready for further tweaking.</div><div class=""><br class=""></div><div class="">In some sense, this provides the infrastructure for running a non-destructive filter plug-in, which keeps track of all the editing steps applied in the plug-in itself. Of course, one can also go from layer B to a new layer C, and so on…</div><div class=""><br class=""></div><div class="">Just to get an idea, you can see this concept in action in the GIMP case here: <a href="https://www.youtube.com/watch?v=945OnK93C1g" class="">https://www.youtube.com/watch?v=945OnK93C1g</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">In order to implement the same mechanism in Krita, and provided you are interested in such an extension, I would need to find the proper way to store some meta-data, in the form of an array of characters, in the information associated to Krita layers. </div><div class=""><br class=""></div><div class="">To me, it seems that KisAnnotation objects are the most appropriate solution, but as far as I understand they can only be associate to the whole image, not to individual layers. Is this correct? What would then be the best solution?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks a lot in advance!</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 13 Mar 2017, at 11:19, Boudewijn Rempt <<a href="mailto:boud@valdyas.org" class="">boud@valdyas.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">On Fri, 10 Mar 2017, EI wrote:<br class=""><br class=""><blockquote type="cite" class="">Screencast looks impressive!<br class=""><br class="">- I don't think there a way to prioritize which plugin will handle loading.<br class="">One option may be to add a menu item under "File" for PhotoFlow. The<br class="">actions are configured through krita/kritamenu.action<br class=""><br class="">- Krita can keep almost arbitrary metadata for the loaded image. An example<br class="">can be found here: krita/libs/image/tests/kis_meta_data_test.cpp. The code<br class="">itself is in krita/libs/image/metadata/. However, your plugin would have to<br class="">write this metadata to the raw file and then read it. Storing metadata in<br class="">an xml "sidecar" file may be easier.<br class=""></blockquote><br class="">The metadata is really meant for official metadata structures, like exif. Krita metadata is also associated with the layer, not the image. I'm not sure it's the right thing here, better investigate KisAnnotation.<br class=""><br class=""><blockquote type="cite" class=""><br class="">- Have you looked at QProcess? <a href="http://doc.qt.io/qt-5/qprocess.html" class="">http://doc.qt.io/qt-5/qprocess.html</a><br class=""><br class="">- You can probably request a developer account. <a href="mailto:boud@valdyas.org" class="">boud@valdyas.org</a> may be<br class="">able to help. Is your plugin code available through<br class=""><a href="https://github.com/aferrero2707/PhotoFlow?" class="">https://github.com/aferrero2707/PhotoFlow?</a><br class=""></blockquote><br class="">To get a KDE developer account, follow <a href="https://community.kde.org/Infrastructure/Get_a_Developer_Account" class="">https://community.kde.org/Infrastructure/Get_a_Developer_Account</a> and mention me as sponsor, indeed.<br class="">-- <br class="">Boudewijn Rempt | <a href="http://www.krita.org" class="">http://www.krita.org</a>, <a href="http://www.valdyas.org" class="">http://www.valdyas.org</a><br class=""></div></blockquote></div><br class=""></div></body></html>