Skip to content

Instantly share code, notes, and snippets.

@njsmith
Created July 4, 2015 21:37
Show Gist options
  • Select an option

  • Save njsmith/3be3b8431f5262b5c8ce to your computer and use it in GitHub Desktop.

Select an option

Save njsmith/3be3b8431f5262b5c8ce to your computer and use it in GitHub Desktop.
N = 100
x = np.linspace(0, 1, N)
jet_samples_sRGB = jet(x)
jet_samples_Jpapbp = cspace_convert(jet_samples_sRGB, "sRGB1", "CAM02-UCS")
distances = np.cumsum(np.sqrt(np.sum((jet_samples_Jpapbp[:-1, ...] - jet_samples_Jpapbp[1:, ...]) ** 2), axis=-1))
distances = np.concatenate(([0], distances))
newjet_samples_Jpapbp = np.interp(x, distances, jet_samples_Jpapbp)
newjet_samples_sRGB = cspace_convert(newjet_samples_Jpapbp, "CAM02-UCS", "sRGB1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment