image - Background converted from white to grey when read in matlab -


i have image: enter image description here can seen background white, , when viewed in finder/explorer shows background white or light grey.

but when read image matlab using basic command: imread(img_name);

it read in this:

enter image description here

why changing colour of background?

i thought maybe indexed , tried converting grey command:

[map, im] = imread(img_name); new = in2gray(im, map); 

but didn't work error stating map not valid colourmap

edit imfinfo output added:

              filename: 'u:\iam_manual\010.png'            filemoddate: '27-jun-2015 17:32:03'               filesize: 1843331                 format: 'png'          formatversion: []                  width: 2078                 height: 2056               bitdepth: 8              colortype: 'indexed'        formatsignature: [137 80 78 71 13 10 26 10]               colormap: [256x3 double]              histogram: []          interlacetype: 'none'           transparency: 'none' simpletransparencydata: []        backgroundcolor: []        renderingintent: 'perceptual'         chromaticities: [0.3127 0.3290 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600]                  gamma: 0.4545            xresolution: 3779            yresolution: 3779         resolutionunit: 'meter'                xoffset: []                yoffset: []             offsetunit: []        significantbits: []           imagemodtime: []                  title: []                 author: []            description: []              copyright: []           creationtime: []               software: 'paint.net 4.0.5'             disclaimer: []                warning: []                 source: []                comment: []              othertext: [] 

it seems image indeed indexed one, should read image , colormap:

[img map] = imread( img_name ); %// note img before map output imshow( img, map ); 

should trick.


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -