snipy/img/imageutil.py
def snoise2dz(size, z, scale=0.05, octaves=1, persistence=0.25, lacunarity=2.0):
    """
    z as seeds
    scale이 작을 수록 패턴이 커지는 효과
    """
    import noise
    z_l = len(z)

    data = np.empty((z_l, size[0], size[1]), dtype='float32')
    for iz in range(z_l):
        zvalue = z[iz]
        for y in range(size[0]):
            for x in range(size[1]):
                v = noise.snoise3(x * scale, y * scale, zvalue,
                                  octaves=octaves, persistence=persistence, lacunarity=lacunarity)
                data[iz, y, x] = v
    data = data * 0.5 + 0.5
    if __debug__:
        assert data.min() >= 0. and data.max() <= 1.0
    return data
def snoise2dz(size, z, scale=0.05, octaves=1, persistence=0.25, lacunarity=2.0):
    """
    z as seeds
    scale이 작을 수록 패턴이 커지는 효과
    """
    import noise
    z_l = len(z)

    data = np.empty((z_l, size[0], size[1]), dtype='float32')
    for iz in range(z_l):
        zvalue = z[iz]
        for y in range(size[0]):
            for x in range(size[1]):
                v = noise.snoise3(x * scale, y * scale, zvalue,
                                  octaves=octaves, persistence=persistence, lacunarity=lacunarity)
                data[iz, y, x] = v
    data = data * 0.5 + 0.5
    if __debug__:
        assert data.min() >= 0. and data.max() <= 1.0
    return data
z as seeds
    scale이 작을 수록 패턴이 커지는 효과