function [out] = histogramGrayscale(image)
    %image ideally is already grayscaled rbg2gray() if needed
    
    [x,y] = size(image);
    out = zeros(1,255);
    
    for i = 1:x
        for j = 1:y
            pixel = image(i,j);
            if pixel ~= 0
                out(pixel) = out(pixel)+1;
            end
        end
    end
end