数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors
實(shí)驗(yàn)要求:
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.
這次實(shí)驗(yàn)是生成網(wǎng)頁(yè)安全色模板,內(nèi)容較簡(jiǎn)單,直接上代碼。
實(shí)驗(yàn)代碼:
% 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');實(shí)驗(yàn)結(jié)果:
總結(jié)
以上是生活随笔為你收集整理的数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 数字图像处理实验(13):PROJECT
- 下一篇: 数字图像处理实验(15):PROJECT