function [image] = pz4(type,level)

    s = imread('cameraman.tif');

    if type == 1
        S = fft2(s); % Fast Fourier transform 2D / For ND use fftn();
        
        surf(abs(S))
    elseif type  == 2
        S =dht(s,1);
    end

    t1 = find_zero(S);

	S_min = min(min(abs(S)));
    S_max = max(max(abs(S)));
    
    h = S_min*level;

    S = compress_h(S,h);
    
    t2 = find_zero(S);

    [N1, N2] = size(S);
    P = N1*N2/(N1*N2 - (t2 - t1))
    
    if type == 1
        s2 = ifft2(S);
    elseif type  == 2
        s2 =dht(S,2);
    end

    s2 = uint8(s2);
    %imshow(s2)
    
    end