Skip to main content
Known Participant
June 2, 2010
Question

Individual pixels from an image?

  • June 2, 2010
  • 1 reply
  • 1049 views

Hi all,

I'm new to Lightroom plugin development, and hopefully this problem won't stop me in my tracks 🙂

I've search the SDK docs as well as google, but I have not been able to find out how you can get the individual pixel values for an image.  Given an image, I want access to every RBG value.  Is this even possible?  Thanks in advance!

This topic has been closed for replies.

1 reply

PaulWaldoAuthor
Known Participant
June 3, 2010

I've realized I probably need to be a little more specific :-)  What I want to do is examine an image's RBG data in a read-only fashion and update the image's metadata based on crunching the RGB data.  From more perusal of the docs, I'm pretty sure this is not possible and maybe even discouraged.  The only other option I see is using an Export Post Process action.  I would have to export all the photos to disk, pull out the RBG data using some external process, then somehow push that value back to Lightroom.  Methinks this plugin will be no speed demon :-O

I can handle the exporting of the images, and can easily get the RBG info I need, but I don't see how I can the data pushed back into LIght room when done.  Any ideas?  Thanks in advance!

JW Stephenson
Inspiring
June 3, 2010

First off, be sure the data you want to change can be modified by the LR SDK.  Review the fields in photo:setRawMetadata documentation.

If you can write the LR fields you desire, or if you are planning on modifying user-defined fields, the I think the only way you can do this is to (1) create your own export routine, (2) pause after each LR rendering and execute your external RBG reading software, (3) have the RBG reading software somehow write the data you need out to a low level file such as a text file, and (4) using lua file commands, read that file into a LR variable that you can then stuff back into LR.  Since lua is not a language I am deeply familiar with, I only assume it has low-level file reading capability - I don't personally know the command or syntax.

This may or may not work, I obviously have not tried it personally.  There may also be an easier way to get LR to bring the results of an external application into a memory variable but I could not find it.  Hopefully someone else will make a suggestion as well.

Good Luck!

Jeff

escouten
Adobe Employee
Adobe Employee
June 3, 2010

JW has pointed you in basically the right direction. There is no provision in the SDK for pixel-level access, so you would have to do the pixel interpretation via some sort of external process.