Black/white image white part

Source: Internet
Author: User

Lab requirements

Stein_ B _white.bmp is a binary image. Change the white color in the color palette to gray or another color.

 

Tip:

Windows bitmap stores binary images as index formats. The bitmap contains a palette with only two color palette items. Each pixel has only one data item, the values can be 0 or 1, which correspond to the first and second items of the color palette respectively. The color palette of the Windows map supports 8-bit colors. For example, the two items of the color palette are [0 0 0] and [255 255 255]. black and white respectively. In this experiment, you only need to change the color palette. Note that the color palette in MATLAB is represented by the number of points. The black bit [0 0 0] and the white bit [1 1 1] need to be converted.

> A = imread ('f:/einstein_ B _white.bmp ');

> Imshow ()

> Imshow (A, [0 0 0; 0.5 0.5]) (white to gray)

> Imshow (A, [0 0 0; 0 0 1]) (white to blue)

> Imshow (A, [0 0 0; 1 0 0]) (white to red)

> Imshow (A, [0 0 0; 0 1 0]) (white to green)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.