您的位置:首页 > 编程语言 > MATLAB

数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors 标签: 图像处理MATLAB 2017-05-27 20:45 116人阅读

2017-05-27 20:45 726 查看

实验要求:

Objective:
To know what are Web-safe colors, how to generate the RGB components for a given jpeg color image, or convert an image to RGB manually?
Main requirements:
Ability of programming with C, C++, or Matlab.
Instruction manual:
In order to complete this project, it is necessary that you find a program capable of generating the RGB component images for a given jpg color image. For example, MATLAB’s Image Processing Toolbox can do this, but you can also do it with image editing programs like Adobe’s Photo-Shop or Corel’s Photo-Paint. It is acceptable for the purposes of this project to convert an image to RGB (and back) manually.
(a) Write a computer program that converts an arbitrary RGB color image to a web-safe RGB image (see Fig. 6.10 for a definition of web-safe colors).
(b) Download the image in Fig. 6.8 and convert it to a web-safe RGB color image. Figure 6.8 is given in jpg format, so convert your result back to jpg (see comments at the beginning of this project). Explain the differences between your result and Fig. 6.8.

这次实验是生成网页安全色模板,内容较简单,直接上代码。

实验代码:

%
close all;
clc;
clear all;

%
img = imread('Fig6.08.jpg');
figure;
subplot(1,2,1);
imshow(img);
title('original image');

%
img1 = fix((img/51)*51);
subplot(1,2,2);
imshow(img1);
title('web colors');

实验结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐