7 Replies Latest reply: Oct 23, 2015 6:45 AM by Daniel Nasseh RSS

    Different transparancy / color in an image based on frequencies

    Daniel Nasseh

      Hello everyone,


      maybe you know images like those:



      So basically within this image we have different "areas" and every area is colored according to a specific frequency of an occurence.


      So no my case is a bit different. I want to create the silouette of a body.

      Then i want to add "organs". According to the events within an organ ("e.g. injury) i want to grade its color in respect to all other organs.


      So lets say we have 100 injuries. 5 occure within the brain, 95 within the lung then the lung should be much darker.


      My idea would be the following:

      1. I draw the silouette of a body.

      2. For every organ i create a button with a bright red color.

      3. I have a table which tells me e.g. brain = 5, lung = 95 etc.

      4. Now according to this table, the transparancy of the button changes. E.g. brain transparency = 95%, lung = 5%.


      So i guess there is a way to specify the transparency of a button according to a table. I have no clue how to do this yet, but does anyone have any idea how to start this? I am not shy of work - so i am open for any idea - even if it means tons of work!

        • Re: Different transparancy / color in an image based on frequencies
          Ruben Marin

          Hi Daniel, there is an ARGB() function wich have 4 parameters whose values goes from 0 to 255:

          1st: transparency, lower value means more transparent

          2nd: red code

          3rd: green code

          4th: blue code


          So Argb(128,255,0,0) gives a semi-transpared red, you can work the formula that returns the results you're expecting, ie:


            • Re: Different transparancy / color in an image based on frequencies
              Daniel Nasseh

              Hello Ruben,


              thanks a lot for your reply.


              Now at the moment i am not sure where to "put" the code you just wrote and what action i need to define to call it.

              So i created a textbox with a background and tried to put it under

              Action => Dynamic Update => =Argb(128,255,0,0)


              Does not rly work yet.


              What i figured out what alrdy worked for me was writing (or rather copiing) a VBSkript Macro and calling it when the document opens or changes:


              sub SetTransparentImage

                set image = ActiveDocument.GetSheetObject("TX11")

                set imageProps = image.GetProperties

                imageProps.Layout.BkgAlpha = 50

                image.setProperties imageProps

              end sub


              So this changes the transparency of the image TX11 to 50%. My problem here would be, that i do not know how to change the Alpha to the values according to my table.


              Anyways - i would rather prefer the solution you suggested with the different color channels, but like i said i do not know yet where to put the given code so that the images dynamically update when a change in the table occures.