数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors ...

实验要求:

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');

实验结果:
这里写图片描述

转载于:https://www.cnblogs.com/xuhongbin/p/7134156.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值