Copy link to clipboard
Copied
Hello, dear community,
I am beginning to develop a plugin for lightroom which will be able to detect face, eyes etc by using machine learning. Based on theese obtained information I want to crop the photo so I could create portrait picture. I could not find any information in API reference or SDK manual whether it is possible to work with location of pixel(x,y). Does somebody came across something similarly?
Thank you.
Copy link to clipboard
Copied
The SDK doesn't provide direct access to the pixels of an image. A plugin must export the image (e.g. as a TIFF) and then read the exported image. See LrExport and related modules for exporting images. A couple of my plugins then use Imagemagick to convert the TIFFs to PPM format, which is much easier to read (without aid of a library).
[Use the blue reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
Thank you for your answer. It was very helpful to me.
Also if I may, I woul like to ask you one more question.
In LrPhoto.getDevelopSettings() I can get information about CropBottom, CropTop, CropLeft, CropRight, is there a way that I can also set these params? Because I could not find anything. Only in LrDevelopController.selectTool( tool ), I can insert param "Crop" but there are not any further information on how to work with it. I also found method in LrPhoto.quickDevelopCropAspect() but there was no option of centering the cropping or its position.
Copy link to clipboard
Copied
You can use the undocumented photo:applyDevelopSettings (settings). In Develop, a plugin can also use LrDevelopController.setValue (param, value), where "param" and "value" are the same crop settings as returned by photo:getDevelopSettings(). (This too is undocumented.)
[Use the blue reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
This new plug-in may provide some insights https://github.com/colin0brass/FaceLabellingExportLrPlugin