colorizing pictures
\externalfigure has a "color" parameter. It used to be possible to colorize greyscale pictures with that, but it doesn’t work any more: %%% \setupcolors[state=start] \setupexternalfigures[ location={local,global,default}, ] \starttext \externalfigure[img/minidodo_g][width=.3\textwidth,color=red] % greyscale \externalfigure[img/minidodo_b][width=.3\textwidth,color=green] % bitmap \externalfigure[cow][width=.3\textwidth,color=blue] % vector \stoptext %%% Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD
On 3/18/2019 7:45 PM, Henning Hraban Ramm wrote:
\externalfigure has a "color" parameter. It used to be possible to colorize greyscale pictures with that, but it doesn’t work any more:
%%% \setupcolors[state=start] \setupexternalfigures[ location={local,global,default}, ]
\starttext
\externalfigure[img/minidodo_g][width=.3\textwidth,color=red] % greyscale \externalfigure[img/minidodo_b][width=.3\textwidth,color=green] % bitmap \externalfigure[cow][width=.3\textwidth,color=blue] % vector
\stoptext
from one of the manuals ... \starttext \definecolor [my-blue] [c=1,m=.38,y=0,k=.64] % pms 2965 uncoated m \definecolor [my-yellow] [c=0,m=.28,y=1,k=.06] % pms 124 uncoated m \definespotcolor [my-blue-100] [my-blue] [p=1] \definespotcolor [my-yellow-100] [my-yellow] [p=1] \definespotcolor [my-blue-50] [my-blue] [p=.5] \definespotcolor [my-yellow-50] [my-yellow] [p=.5] \definemultitonecolor [my-mix] [my-blue=.12,my-yellow=.28] [c=.1,m=.1,y=.3,k=.1] \starttabulate[|T||] \NC my-blue \NC \blackrule[color=my-blue, width=.6\textwidth,height=5mm] \NC \NR \NC my-blue-50 \NC \blackrule[color=my-blue-50, width=.6\textwidth,height=5mm] \NC \NR \NC my-blue-100 \NC \blackrule[color=my-blue-100, width=.6\textwidth,height=5mm] \NC \NR \NC my-yellow \NC \blackrule[color=my-yellow, width=.6\textwidth,height=5mm] \NC \NR \NC my-yellow-50 \NC \blackrule[color=my-yellow-50, width=.6\textwidth,height=5mm] \NC \NR \NC my-yellow-100 \NC \blackrule[color=my-yellow-100,width=.6\textwidth,height=5mm] \NC \NR \NC my-mix \NC \blackrule[color=my-mix, width=.6\textwidth,height=5mm] \NC \NR \stoptabulate \useexternalfigure[demofig][mill.png][object=no,width=.2\textwidth] \startcombination[4*1] {\externalfigure[demofig]} {no color} {\externalfigure[demofig][color=my-mix]} {indexed duotone} {\externalfigure[demofig][color=my-blue-100]} {spot color} {\externalfigure[demofig][color=my-yellow-100]} {spot color} \stopcombination \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Am 2019-03-19 um 13:23 schrieb Hans Hagen
On 3/18/2019 7:45 PM, Henning Hraban Ramm wrote: from one of the manuals ...
\starttext
\definecolor [my-blue] [c=1,m=.38,y=0,k=.64] % pms 2965 uncoated m \definecolor [my-yellow] [c=0,m=.28,y=1,k=.06] % pms 124 uncoated m
\definespotcolor [my-blue-100] [my-blue] [p=1] \definespotcolor [my-yellow-100] [my-yellow] [p=1] \definespotcolor [my-blue-50] [my-blue] [p=.5] \definespotcolor [my-yellow-50] [my-yellow] [p=.5]
\definemultitonecolor [my-mix] [my-blue=.12,my-yellow=.28] [c=.1,m=.1,y=.3,k=.1]
So it works only with toned or multitone colors and only with _some_ greyscale pictures, not with bitmaps and also not with my greyscale dodo. I can also only use one version my-blue – if I use my-blue-100, then my-blue-50 stays grey, and if I only use my-blue-50, it’s the same tone as 100. Something’s very fishy. \setupexternalfigures[ location={local,global,default}, ] \definecolor [my-blue] [c=1,m=.38,y=0,k=.64] % pms 2965 uncoated m \definecolor [your-blue] [c=1,m=.38,y=0,k=.64] % pms 2965 uncoated m \definecolor [my-yellow] [c=0,m=.28,y=1,k=.06] % pms 124 uncoated m \definespotcolor [my-blue-100] [my-blue] [p=1] \definespotcolor [my-yellow-100] [my-yellow] [p=1] \definespotcolor [my-blue-50] [my-blue] [p=.5] \definespotcolor [my-yellow-50] [my-yellow] [p=.5] \definespotcolor [your-blue-100] [your-blue] [p=1] \definemultitonecolor [my-mix] [my-blue=.12,my-yellow=.28] [c=.1,m=.1,y=.3,k=.1] \useexternalfigure[milli][mill.png][object=no,width=.3\textwidth] \useexternalfigure[dodog][img/dodo_g.png][object=no,width=.3\textwidth] \useexternalfigure[dodob][img/dodo_1bit.png][object=no,width=.3\textwidth] \useexternalfigure[cowi][cow.pdf][object=no,width=.3\textwidth] \define[1]\FIG{% \section{#1} \startcombination[3*1] {\externalfigure[milli][color=#1]} {grey} {\externalfigure[dodog][color=#1]} {grey} {\externalfigure[dodob][color=#1]} {bitmap} \stopcombination } \starttext %\FIG{blue} %\FIG{my-blue} %\FIG{my-blue-100} %\FIG{my-blue-50} %\FIG{my-mix} \FIG{my-blue-50} \FIG{your-blue-100} \FIG{my-mix} \stoptext Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD
On 3/19/2019 4:23 PM, Henning Hraban Ramm wrote:
Am 2019-03-19 um 13:23 schrieb Hans Hagen
: On 3/18/2019 7:45 PM, Henning Hraban Ramm wrote: from one of the manuals ...
\starttext
\definecolor [my-blue] [c=1,m=.38,y=0,k=.64] % pms 2965 uncoated m \definecolor [my-yellow] [c=0,m=.28,y=1,k=.06] % pms 124 uncoated m
\definespotcolor [my-blue-100] [my-blue] [p=1] \definespotcolor [my-yellow-100] [my-yellow] [p=1] \definespotcolor [my-blue-50] [my-blue] [p=.5] \definespotcolor [my-yellow-50] [my-yellow] [p=.5]
\definemultitonecolor [my-mix] [my-blue=.12,my-yellow=.28] [c=.1,m=.1,y=.3,k=.1]
So it works only with toned or multitone colors and only with _some_ greyscale pictures, not with bitmaps and also not with my greyscale dodo.
It uses an indexed (256 so one byte) image ... coloring a cow is no option anyway as there the pdf object is an independent thing (i coul dprobably inject color directives if needed but that could then interfere with the way such a pdf stream is set up.
I can also only use one version my-blue – if I use my-blue-100, then my-blue-50 stays grey, and if I only use my-blue-50, it’s the same tone as 100.
Something’s very fishy. Could be but it's actually more a gimmick as we can't really mess to much with the internals of images (they can have masks, palettes, etc etc).
Later this year there might be other tricks on our sleeves but I'm not going to touch the code now. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Am 2019-03-19 um 16:34 schrieb Hans Hagen
On 3/19/2019 4:23 PM, Henning Hraban Ramm wrote:
Am 2019-03-19 um 13:23 schrieb Hans Hagen
: On 3/18/2019 7:45 PM, Henning Hraban Ramm wrote: from one of the manuals ...
\starttext
\definecolor [my-blue] [c=1,m=.38,y=0,k=.64] % pms 2965 uncoated m \definecolor [my-yellow] [c=0,m=.28,y=1,k=.06] % pms 124 uncoated m
\definespotcolor [my-blue-100] [my-blue] [p=1] \definespotcolor [my-yellow-100] [my-yellow] [p=1] \definespotcolor [my-blue-50] [my-blue] [p=.5] \definespotcolor [my-yellow-50] [my-yellow] [p=.5]
\definemultitonecolor [my-mix] [my-blue=.12,my-yellow=.28] [c=.1,m=.1,y=.3,k=.1] So it works only with toned or multitone colors and only with _some_ greyscale pictures, not with bitmaps and also not with my greyscale dodo.
It uses an indexed (256 so one byte) image ... coloring a cow is no option anyway as there the pdf object is an independent thing (i could probably inject color directives if needed but that could then interfere with the way such a pdf stream is set up.
I didn’t expect PDF to work (I remember colored cows, but those were probably MP), and I must analyze why your greyscale PNG works and not mine.
I can also only use one version my-blue – if I use my-blue-100, then my-blue-50 stays grey, and if I only use my-blue-50, it’s the same tone as 100. Something’s very fishy. Could be but it's actually more a gimmick as we can't really mess to much with the internals of images (they can have masks, palettes, etc etc).
Understood. But colorizing grey pictures is a nice feature that I’m used to use in InDesign (and in QuarkXPress earlier).
Later this year there might be other tricks on our sleeves but I'm not going to touch the code now.
I’m looking forward to those. Since I’m working at my ConTeXt book again, I’m researching which parameters and features actually work and how. This looks like a case that I won’t include in the book but only document in the wiki. Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD
On 3/19/2019 6:54 PM, Henning Hraban Ramm wrote:
Since I’m working at my ConTeXt book again, I’m researching which parameters and features actually work and how. This looks like a case that I won’t include in the book but only document in the wiki. we can make it a topic for the ctx meeting ... to what extend do we want to mess runtime with such graphic details and what conditions do we then impose on the original
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Henning Hraban Ramm