<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">

Exported from Notepad++
clc; close all; clear all; T=128; y=imread('cameraman.tif'); z=imread('rice.png'); figure,imshow(y); figure,imshow(z); [m,n]=size(y); [p q]=size(z); for i=1:m for j=1:n if y(i,j)<T a(i,j)=0; else a(i,j)=255; end end end for i=1:p for j=1:q if z(i,j)<T b(i,j)=0; else b(i,j)=255; end end end figure,imshow(a); figure,imshow(b);