function [C] =flushpic(str,N)
%Flushes picture left or right or makes a Steiner symmertization
%
%N=1 - flush left
%N=2 - centerize
%N=3 - flush right
%str='forest.tif' - for example

A=imread(str);
M=max(max(max(A)));
A=M-A;A=A-1;A=max(0,A);
B=min(1,A);
C=B(:,:,1)+B(:,:,2)+B(:,:,3);
C=min(1,C);
[n,m,l]=size(A);
for k=1:n
t=find(C(k,:)~=0);s(k)=length(t);
end

if N==1,
    for k=1:n
    t=find(C(k,:)~=0);s(k)=length(t);
    B(k,1:length(t),:)=A(k,t,:);
    end
elseif N==2,
    for k=1:n
    t=find(C(k,:)~=0);a(k)=length(t);aa(k)=floor(a(k)/2);
    end
    b=max(a);c=floor(b/2);
    for k=1:n
        t=find(C(k,:)~=0);
        B(k,b+1-aa(k):b+a(k)-aa(k),:)=A(k,t,:);
    end
elseif N==3,
    for k=1:n
    t=find(C(k,:)~=0);s(k)=length(t);
    B(k,end-length(t)+1:end,:)=A(k,t,:);
    end
end
M=max(max(max(B)));
B=M-B;
C=B(:,:,1:3);
end

