Splitting an image

Discussion in 'Rebol' started by MaxV, May 23, 2012.

  1. MaxV

    MaxV Member

    Hello,
    does anyone a way to split an image?
    I have an image 64x64 size, and I want to split in slices of 4x64 (this means 16 slices).
  2. MaxV

    MaxV Member

    SOLVED!!!
    Code:
    my_image: load %photo.jpg
    imgs: copy []
    size: 4x64  ; width and height of each subimage
    reps: my_image/size / size ;number of repetitions
    repeat y reps/y  [
        repeat x reps/x  [
            xy: size * as-pair x - 1 y - 1
            append imgs copy/part at my_image xy size
        ]
    ]

Share This Page