Digital Multi-toning is simply an up-gradation of conventional halftone technique. In halftone, a gray scale image is converted to a binary image useful for black and white printing (only use black cartridge). Similarly, digital color halftoning deals with production of printable format color images.
Multitoning is a slight variation to halftone in which instead of binary image, it also use intermediate values of gray scale.
function [Y]=CDM()
%CDM- Clustered Dot Multitoning
%Code by: Sankarasrinivasan S,
%Multimedia Signal Processing Lab
%NTUST, Taipei
%Input Image
im=imread('cameraman.tif');
%Reference
%Y. F. Liu and J. M. Guo, "Clustered-Dot Screen Design for Digital Multitoning," in IEEE Transactions on Image Processing, vol. 25, no. 7, pp. 2971-2982, July 2016.
%Clustered Dot Multitone Screen- Genereated using the referred paper.
DA=[130 94 143 158 176 182 121 159 216 247 254 136 161 169 39 52 239 73 10 27 98 75 9 60 144 192 227 212 199 183 156 224 254 128 40 52 214 190 31 55 90 100 52 18 67 112 140 233 199 187 146 108 243 229 137 131 171 149 35 8 132 96 42 24 60 168 135 92 254 204 176 195 248 234 164 188 243 252 122 11 95 182 26 9 152 165 51 7 217 255 114 92 206 221 164 75 222 241 213 48 77 140 37 20 64 87 44 29 61 180 149 131 255 248 195 67 106 219 231 84 154 178 144 11 137 112 48 38 103 161 141 54 113 243 253 104 193 210 237 194 231 212 25 8 92 110 22 11 174 202 133 24 147 166 123 109 254 245 173 72 199 131 36 147 206 160 51 9 35 76 58 18 96 150 166 191 224 244 254 238 218 128 81 62 243 216 93 27 44 78 55 211 162 167 71 96 116 178 189 221 254 232 170 180 205 132 31 11 99 106 47 24 7 28 152 104 119 138 153 190 220 234 138 61 181 121 200 59 139 44 146 79 57 12 20 81 114 245 255 149 188 208 241 232 245 255 234 202 174 37 43 85 98 71 8 21];
DA=vec2mat(DA,16);
DA(:,:,1)=DA;
DA1=[81 88 136 153 169 164 115 128 206 243 237 125 146 166 29 48 229 68 4 19 83 71 3 15 108 185 223 208 194 176 152 219 247 124 36 46 210 65 23 40 85 78 48 13 62 103 107 213 195 174 118 103 237 223 112 96 155 141 27 1 118 88 34 19 56 161 114 87 250 200 126 183 241 229 159 177 237 248 78 4 84 178 17 1 149 160 45 3 213 124 103 81 202 216 157 68 206 231 209 33 72 121 29 16 59 70 39 22 55 170 145 119 236 227 188 63 99 191 225 79 110 173 134 5 73 106 44 32 99 154 136 43 90 236 248 97 184 206 223 188 226 198 19 1 87 80 17 4 168 181 129 14 141 160 119 101 250 240 126 63 186 120 30 58 197 156 47 3 31 69 53 2 84 142 158 182 219 234 250 229 214 124 73 41 239 201 89 14 39 68 50 204 145 155 67 85 109 171 185 210 249 228 163 176 197 117 24 4 90 77 41 14 1 20 93 100 112 133 148 186 214 229 124 36 177 115 192 54 132 36 88 69 51 2 7 64 109 240 250 103 172 204 217 223 196 250 226 198 167 26 32 75 93 58 1 16];
DA1=vec2mat(DA1,16);
DA(:,:,2)=DA1;
%3-Tone multitone screen.
T=2; %No of screen size is less than 3
bs=16;
[s1 s2]=size(im);
MT=ones(bs,bs);
NT=ones(bs,bs);
for i=1:bs:s1
for j=1:bs:s2
bl=im(i:i+(bs-1),j:j+(bs-1));
for nT=1:1:T
MT=(bl>=DA(:,:,nT));
M(:,:,nT)=MT;
end
for x=1:1:bs
for y=1:1:bs
if(M(x,y,1)==1 )
blc(x,y)=1;
elseif(M(x,y,2)==1)
blc(x,y)=0.5;
else
blc(x,y)=0;
end
end
end
Y(i:i+(bs-1),j:j+(bs-1))=blc;
end
end
imshow(Y);
end

Multitoning is a slight variation to halftone in which instead of binary image, it also use intermediate values of gray scale.
function [Y]=CDM()
%CDM- Clustered Dot Multitoning
%Code by: Sankarasrinivasan S,
%Multimedia Signal Processing Lab
%NTUST, Taipei
%Input Image
im=imread('cameraman.tif');
%Reference
%Y. F. Liu and J. M. Guo, "Clustered-Dot Screen Design for Digital Multitoning," in IEEE Transactions on Image Processing, vol. 25, no. 7, pp. 2971-2982, July 2016.
%Clustered Dot Multitone Screen- Genereated using the referred paper.
DA=[130 94 143 158 176 182 121 159 216 247 254 136 161 169 39 52 239 73 10 27 98 75 9 60 144 192 227 212 199 183 156 224 254 128 40 52 214 190 31 55 90 100 52 18 67 112 140 233 199 187 146 108 243 229 137 131 171 149 35 8 132 96 42 24 60 168 135 92 254 204 176 195 248 234 164 188 243 252 122 11 95 182 26 9 152 165 51 7 217 255 114 92 206 221 164 75 222 241 213 48 77 140 37 20 64 87 44 29 61 180 149 131 255 248 195 67 106 219 231 84 154 178 144 11 137 112 48 38 103 161 141 54 113 243 253 104 193 210 237 194 231 212 25 8 92 110 22 11 174 202 133 24 147 166 123 109 254 245 173 72 199 131 36 147 206 160 51 9 35 76 58 18 96 150 166 191 224 244 254 238 218 128 81 62 243 216 93 27 44 78 55 211 162 167 71 96 116 178 189 221 254 232 170 180 205 132 31 11 99 106 47 24 7 28 152 104 119 138 153 190 220 234 138 61 181 121 200 59 139 44 146 79 57 12 20 81 114 245 255 149 188 208 241 232 245 255 234 202 174 37 43 85 98 71 8 21];
DA=vec2mat(DA,16);
DA(:,:,1)=DA;
DA1=[81 88 136 153 169 164 115 128 206 243 237 125 146 166 29 48 229 68 4 19 83 71 3 15 108 185 223 208 194 176 152 219 247 124 36 46 210 65 23 40 85 78 48 13 62 103 107 213 195 174 118 103 237 223 112 96 155 141 27 1 118 88 34 19 56 161 114 87 250 200 126 183 241 229 159 177 237 248 78 4 84 178 17 1 149 160 45 3 213 124 103 81 202 216 157 68 206 231 209 33 72 121 29 16 59 70 39 22 55 170 145 119 236 227 188 63 99 191 225 79 110 173 134 5 73 106 44 32 99 154 136 43 90 236 248 97 184 206 223 188 226 198 19 1 87 80 17 4 168 181 129 14 141 160 119 101 250 240 126 63 186 120 30 58 197 156 47 3 31 69 53 2 84 142 158 182 219 234 250 229 214 124 73 41 239 201 89 14 39 68 50 204 145 155 67 85 109 171 185 210 249 228 163 176 197 117 24 4 90 77 41 14 1 20 93 100 112 133 148 186 214 229 124 36 177 115 192 54 132 36 88 69 51 2 7 64 109 240 250 103 172 204 217 223 196 250 226 198 167 26 32 75 93 58 1 16];
DA1=vec2mat(DA1,16);
DA(:,:,2)=DA1;
%3-Tone multitone screen.
T=2; %No of screen size is less than 3
bs=16;
[s1 s2]=size(im);
MT=ones(bs,bs);
NT=ones(bs,bs);
for i=1:bs:s1
for j=1:bs:s2
bl=im(i:i+(bs-1),j:j+(bs-1));
for nT=1:1:T
MT=(bl>=DA(:,:,nT));
M(:,:,nT)=MT;
end
for x=1:1:bs
for y=1:1:bs
if(M(x,y,1)==1 )
blc(x,y)=1;
elseif(M(x,y,2)==1)
blc(x,y)=0.5;
else
blc(x,y)=0;
end
end
end
Y(i:i+(bs-1),j:j+(bs-1))=blc;
end
end
imshow(Y);
end

Comments
Post a Comment