Jump to: Board index » General » Fusion

(LUA scripting) Get the color of each pixel from an image

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

godowan

  • Posts: 2
  • Joined: Fri May 20, 2022 3:59 pm
  • Real Name: Godofredo Medina

(LUA scripting) Get the color of each pixel from an image

PostFri May 20, 2022 4:06 pm

Hello! Noob here. Im attempting to write a script that reads every pixel on an image and returns the color of each pixel. For example, if i have a 3x3 image, I want to get the RGB or HEX for the 9 pixels. Is there a way I can do that? Thank you very much!!!
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: (LUA scripting) Get the color of each pixel from an imag

PostSat May 21, 2022 3:45 am

You can do that kind of thing with a Fuse. Easy enough to read every pixel and spit out values in whatever format you like. The old Gain example fuse is a simple shell to start from:

https://www.steakunderwater.com/VFXPedi ... /Gain.Fuse

You'll probably also want to read the Creating Fuses article there, too:
https://www.steakunderwater.com/VFXPedi ... ting_Fuses

Actually, the basic process is so easy that I might as well do it right now.

It merely prints results to the Console. I leave it to you to figure out how to format the data for your needs and send it where you need it to go.
Attachments
pixelReader.zip
(623 Bytes) Downloaded 90 times
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: (LUA scripting) Get the color of each pixel from an imag

PostSat May 21, 2022 3:49 am

Since you said you're a newbie, here's a thread with details about how to install fuses:

viewtopic.php?f=22&t=34059

Scroll down to around June 2020. Fusion standalone and Resolve have different paths for fuse installation, so you'll need to put it in the one that matches the product you use.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

godowan

  • Posts: 2
  • Joined: Fri May 20, 2022 3:59 pm
  • Real Name: Godofredo Medina

Re: (LUA scripting) Get the color of each pixel from an imag

PostSat May 21, 2022 3:29 pm

Excellent! Thank you very much for your answer, Bryan! I'll take a look into fuses. Thanks for your Time!

Return to Fusion

Who is online

Users browsing this forum: No registered users and 34 guests