@@ -189,6 +189,11 @@ def label(ax, s):
189
189
horizontalalignment = "right" ,
190
190
verticalalignment = "bottom" ,
191
191
transform = ax .transAxes )
192
+ def title (ax , s ):
193
+ ax .text (0.98 , 0.98 , s ,
194
+ horizontalalignment = "right" ,
195
+ verticalalignment = "top" ,
196
+ transform = ax .transAxes )
192
197
193
198
Jpapbp = self ._sRGB1_to_uniform (RGB )
194
199
@@ -197,10 +202,14 @@ def delta_ymax(values):
197
202
198
203
ax = axes ['deltas' ]
199
204
local_deltas = N * np .sqrt (np .sum ((Jpapbp [:- 1 , :] - Jpapbp [1 :, :]) ** 2 , axis = - 1 ))
200
- print ("perceptual delta peak-to-peak: %0.2f" % (np .ptp (local_deltas ),))
205
+ # print("perceptual delta peak-to-peak: %0.2f" % (np.ptp(local_deltas),))
201
206
ax .plot (x [1 :], local_deltas )
202
207
arclength = np .sum (local_deltas ) / N
203
- label (ax , "Perceptual deltas (total: %0.2f)" % (arclength ,))
208
+ rmse = np .std (local_deltas )
209
+ title (ax , "Perceptual deltas" )
210
+ label (ax ,
211
+ "Length: %0.1f\n RMS deviation from flat: %0.1f (%0.1f%%)"
212
+ % (arclength , rmse , 100 * rmse / arclength ))
204
213
ax .set_ylim (- delta_ymax (- local_deltas ), delta_ymax (local_deltas ))
205
214
ax .get_xaxis ().set_visible (False )
206
215
@@ -214,9 +223,15 @@ def delta_ymax(values):
214
223
ax .axhline (0 , linestyle = "--" , color = "grey" )
215
224
lightness_deltas = N * np .diff (Jpapbp [:, 0 ])
216
225
ax .plot (x [1 :], lightness_deltas )
226
+ title (ax ,
227
+ "Perceptual lightness deltas" )
228
+ lightness_arclength = np .sum (np .abs (lightness_deltas )) / N
229
+ lightness_rmse = np .std (lightness_deltas )
217
230
label (ax ,
218
- "Perceptual lightness deltas (total: %0.2f)"
219
- % (np .sum (np .abs (lightness_deltas )) / N ,))
231
+ "Length: %0.1f\n RMS deviation from flat: %0.1f (%0.1f%%)"
232
+ % (lightness_arclength ,
233
+ lightness_rmse ,
234
+ 100 * lightness_rmse / np .mean (lightness_deltas )))
220
235
#ax.set_ylim(0, ax.get_ylim()[1])
221
236
ax .set_ylim (- delta_ymax (- lightness_deltas ), delta_ymax (lightness_deltas ))
222
237
ax .get_xaxis ().set_visible (False )
0 commit comments