John Dolese

125 Reputation

3 Badges

6 years, 172 days

MaplePrimes Activity


These are replies submitted by John Dolese

I've been laboring under the false impression that the tool to import data had really added the data to this application.

Since and external Excel file is what is needed. I edited the original post to try to make it possible for anyone interested to access the needed data and put it in a directory of their choosing. I think now I have everything there to allow someone to actually run the application. 

@acer 

Thanks Acer, I should have found floor and ceil and not loaded MTM.  I will read through your examples of using hfloat and will probably have more questions. 

I am impressed with Maples ability to handle symbolics. I guess typing evalf a lot is just the price to pay for having the higher level functionality. 

@Markiyan Hirnyk 

Sorry for the inconvenience.  

@acer 

Which brings me to another question; Is it so unusual for users of Maple to want to convert numbers to integers?   I frequently want to do some math on my indexes, but the result needs to be an integer. 

For that matter why is the default number in Maple not a float? I'm always having to evalf everything to get the results I want. I have yet to come up with a situation where I want pi or some other symbol in my result.

@Markiyan Hirnyk 

I understand. Next time I will fill in the product line. 

I think we are done here. 

Thank you for your quick response.

 

Best Regards,

John Dolese

@Markiyan Hirnyk 

 

Unfortunately MTM[sort] has exactly the same name as sort for lists and listlists. 

 

(Product is Maple18)

@acer 

I'm probably still missing some skills here. However I got some definite improvements by making sure my numbers were float[8]. Is there another way to get this other than;

Array(List,datatype=float[8])   (or similar)?

 

Strangelly the evalhf was choking on the pretty print square root sign. 

deltaE:=evalhf((L1-L2)^2+(a1-a2)^2+(b1-b2)^2)^1/2)  

In a seperate document I was able to use the pretty print (document mode?) square root. Sometimes I think hidden characters get into document mode and screw things up. Especially when cutting and pasting.

 

I tried map2[evalhf](deltaE,Array1,[Array2])  This works ok but the evalhf doen't seem to make any difference. Its still faster to do Array(deltaE(List1,List2),datatype=float[8]).

min[index] is just returning min not the index. I used with(SignalProcessing) Minimum(Array,'index") and that does the job.

arctan(a,b) is almost the ATAN2 function. Like Atan2 arctan(0.0,0.0) is undefined. Curiously arctan(0,0)=0 which is what I wanted for my black point. Anyway it is a little cleaner, but not much faster what I had before.

Should I be thinking about a code edit region and do loops? My experience with the square root sign makes my a little suspicious of the document mode when speed is a consideration.

 

 

@acer 

I tried reducing the precision using Digits and now with evalf8 (subscript 8). Both actually slow down the computation. 

 

With evalhf I get; 

Error, lexical scoping is not supported in evalhf

I'm not sure what lexical scoping is.

 

If by inlining you mean rewriting deltaE as one big function of the 2 inputs, then I can say I tried that with no change in speed. I went back to the subfunctions as it is easier to see what is going on. 

 

(atan2 returns numbers between -pi and pi. I took some liberties with atan2(0,0) as I didn't want the hue angle of the black point to be undefined.)

 

I will try out the min[index] function and tomleslie 659s suggestion for the 2 element arctan function. 

@acer 

Plot is fast and gets all the info up at once. I have some trouble with the plotoption size being confused with ArrayTools Size. I just put my plots in a table and size them with click and drag. 

 

Thanks

@acer 

I think my problem is that colors cannot be displayed in the text component.  I replaced the use ColorTools as suggested with;

Do(%outcolor=ColorTools:-Color(my_rgb(%n)));

The result is still;

module () local colorspace, coordinates, color_caption; option object; end module

Not the color of my_rgb(n).

restart

with(ColorTools): NULL

NULL

NULL

myColors := [[0.3e-1, 0, .15], [.25, 0, .72], [.38, 0, 1], [.17, 0, 1], [0, .38, 1], [0, .7, .66], [0, 1, .15], [0, 1, 0], [0, 1, 0], [1, 1, 0]]:
 

NULL

NULL

`<,>`(seq(Color(myColors[n]), n = 1 .. 10)) = "[[[<RGB : 0.03 0 0.15>],[<RGB : 0.25 0 0.72>],[<RGB : 0.38 0 1>],[<RGB : 0.17 0 1>],[<RGB : 0 0.38 1>],[<RGB : 0 0.7 0.66>],[<RGB : 0 1 0.15>],[<RGB : 0 1 0>],[<RGB : 0 1 0>],[<RGB : 1 1 0>]]]"NULL

my_rgb := proc (n) options operator, arrow; myColors[n] end proc = proc (n) options operator, arrow; myColors[n] end procNULLNULL

my_rgb(3) = [.38, 0, 1]NULL

color_my_rgb := proc (n) options operator, arrow; Color(my_rgb(n)) end proc = proc (n) options operator, arrow; ColorTools:-Color(my_rgb(n)) end procNULL

color_my_rgb(3) = ColorTools:-Color("RGB", [.38, 0., 1.])NULL

NULL

NULL

n

 

NULL

NULL

 outn

outrgb

outcolor

NULL

NULL

NULL


Download Component_Color2.mw

@acer 

Thanks for taking an interest in my application. I got motivated to do this through a discussion by two print gurus on dpreview about using fully saturated ProPhoto Blue to test the out of gamut mapping for print. One claimed that since the Lab L value was essentially black that it should print as black. The other liked the rendering as a visible blue. This strikes me a similar to the issue for WavelengthToColor. My thought would be that the hue must be preserved. Obviously the saturation gets reduced. That leaves the philosophy of what to do about the value. I lean toward moving the value in the direction of the midtones. Preserving hue means keeping the angle relative to the a-b axes constant? 

 

I'm really liking Maples 3d plots for viewing the Lab space. It will be very interesting to add my printer ink data to the plots. As I understand things, printers exceed aRGB in some places but may be lacking in others.

@acer 

I mistakenly made the xy points in Figures 1 and 2 a set rather than a list. That is why I get the green tale on the violets.  I'm not feeling so picky about the color accuracy. Clearly noone can see fully saturated single wavelength colors on their monitor. My guess is that the RGB colors in maple are set to be more or less correct on an sRGB monitor. They of course will appear diffent on monitors that are set to aRGB or more likely monitors that are not calibrated to any standard. Maybe if lots of people start using maple for color work you guys will add color management to the program and define what RGB means.

 

Anyway the point of this exercise is that every point on the xyY plot (and Lab plot) corresponds to one wavelength. The color maybe just suggests something about what wavelength that might be. Think of magic paint chips that reflect 100% of the energy of one wavelength and nothing else. The color mathing functions of the eye produce a luminance for each color. Some colors appear brighter to the eye than others. Yellow for instance always is bright while violets are dark. 

Vision_Gamut.mw

@acer 

To see the plot commands the Table Property, Show Input, must be checked.

 

Colors in the figures come from the WavelengthToColor command for the wavelength associated with each xy point. I think the plots showing a colored surface are using artistic license. As can be seen when converting to Lab, the perception of violed and far red come together. Of course Lab is only an approximation of what we see. I'm no expert on this but am having fun learning.

I'd like to be able to generate more points on the Lab surface for the maximum chroma at different L values. These would come from combining the effects of the extreme values I've shown. For instance white is just the combination of all the points.

 

One bug I need to fix is the green that shows up for the extreme violets in Figure 2. WavelengthToColor says these will be black as expected, but with lots of points plotted close together it shows up green.

John

@acer 

 

Using map sure eliminates a lot of fuss. I think I prefer just naming the map function instead of substitute;

map_to_FX := v->map(vx->F.vx,v):

map_to_FX(CCXYZ_D50):

instead of

sub_to_F:=subs(_OP=F,v->OP.v):

map(sub_to_F,CCXYZ_D50):

 

map2 sounds like a good thing for modifying the conversion for different conditions (D50, D65 etc). I'm sure these color space conversions are nothing very original. I just wanted something interesting to help me learn maple. The array of vectors just helps me remember where the colors reside on my color checker card. Also since most photos are 2d it might be of some use to be able to index through such an array.

Thanks again for the great suggestions.

1 2 Page 1 of 2