Adaptive colour for fonts

Moderator: jsachs

tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Adaptive colour for fonts

Post by tomczak »

Another very low-priority idea, probably not even a good one. I got inspired by NASA posters of various planets, suns and moons, with captions (typically on darker background) that corresponded to the tonality of the image.

One way of accomplishing it is choosing Text Color from the image by probing in Color Picker with a larger radius (although at least once I struggled to get the overall tonality as the max radius was 9 pixels and it was picking the individual colours from the pattern that was a similar size, but I blurred the image and made it work.

But I was thinking that in a batch file, it could be useful if the color of the font could be selected automatically from the overall image tonality, with some user adjustable parameters such as brightness or a threshold of how much is excluded from the tonality calculation?
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Adaptive colour for fonts

Post by jsachs »

This kind of color picker would be complicated to implement since it would create a new image dependency for any transformation that used it. Currently the infrastructure to support this do not exist. It would be less of a stretch to make something like this work for transformations such as Composite that can accept either an image or a solid color, and Composite could be used to color text if the text is created as a mask. I suppose you could do something similar now by cropping a bit of an image whose color you want to sample, blurring it heavily, and then resizing it and using it as an overlay image in Composite.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Adaptive colour for fonts

Post by tomczak »

Ok, thanks. I think I get the colour part (in batch), but how do I make the text that would use this colour to become an Overlay image with the mask compositing the text I want - probably different for each image in the batch?
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Adaptive colour for fonts

Post by jsachs »

Just apply white text to a black background image -- then you can use it as a mask. There are examples in Transformations.pdf -- see under Text / Text Effects.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Adaptive colour for fonts

Post by tomczak »

I ended up designing something like this, using a test image first, but there is probably a better way...
Attachments
Add adaptive colour text to the image.zip
(1.35 KiB) Downloaded 130 times
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Adaptive colour for fonts

Post by jsachs »

That's the simplest way I know of. If there were a text tool in the Mask dialog box, it would be easier.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Adaptive colour for fonts

Post by tomczak »

One comment on this workflow: it uses File New with the Reference image being the input image on which I want to inscribe the text - I want the B&W mask of the same size as the input image. Editing/reopening the File New transformation opens with blank Reference image (i.e. I need to point out to the Reference image again) and then, when I do, it defaults to Type = 24 bit (consistent with the reference image, but it doesn't keep 8bit B&W that I set before, required for the mask).
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Adaptive colour for fonts

Post by jsachs »

Fixed for next release.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1367
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Adaptive colour for fonts

Post by tomczak »

The white highlight on the header of Overlay Mask thumbnail is always white - should it?
Attachments
2021-03-18_222110.png
2021-03-18_222110.png (67.6 KiB) Viewed 2917 times
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Adaptive colour for fonts

Post by jsachs »

Fixed for next release -- it is supposed to be highlighted when the corresponding Mask dialog box is open and un-highlighted when you close the Mask dialog box is closed, but the latter was not happening.
Jonathan Sachs
Digital Light & Color
Post Reply