Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created October 30, 2018 19:05
Show Gist options
  • Save Sciss/8bc95318413748c75bbfd986b51e3fb3 to your computer and use it in GitHub Desktop.
Save Sciss/8bc95318413748c75bbfd986b51e3fb3 to your computer and use it in GitHub Desktop.
val in1 = ImageFileIn("in1")
val in2 = ImageFileIn("in2")
val width = 1116
val height = 372
val f1 = Real2FullFFT(in1,rows = height, columns = width)
val f2 = Real2FullFFT(in2,rows = height, columns = width)
val mixA = f1 atan2 f2
val mixB = f1 roundTo f2
val mix = mixA.complex * mixB
val back = Real2FullIFFT(mix, rows = height, columns = width)
val min = RunningMin(back).last
val max = RunningMax(back).last
val norm = BufferDisk(back).linLin(min, max, -1.0, 1.4).clip(0.0, 1.0)
val spec = ImageFile.Spec(width = width, height = height, numChannels = 3)
import de.sciss.file._
val fOut = userHome / "test.png"
de.sciss.fscape.graph.ImageFileOut(norm,fOut,spec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment