help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

8Bit Image saved as BMP gets saved as a 24Bit IMage


From: ijourneaux
Subject: 8Bit Image saved as BMP gets saved as a 24Bit IMage
Date: Thu, 16 Jul 2015 09:59:04 -0700 (PDT)

I have a large 8-bit BMP image that I am trying to break up into pieces. When
I Save each of the sub images, the resulting BMP is 24 Bit. This behavior is
observed in Octave 3.8.2 and Octave 4.0 under Windows. This doesn't happen
with other file formats such as PNG or TIF

Is there a way to save an 8-bit BMP using imwrite?

Here is a simple script that highlights the problem

addpath("e:/pinstripe")
clear
fname=('D2801fullsize');
T=imread(strcat(fname,'.bmp'));
index=0;
for i=1:3;
        for j=1:3;
                index=index+1;
                fnames=strcat(fname,'_',num2str(index),'.bmp');
                As=T(1+(i-1)*500:480+(i-1)*500,1+(j-1)*400:480+(j-1)*400);
                imwrite(As,fnames);
        end
end



--
View this message in context: 
http://octave.1599824.n4.nabble.com/8Bit-Image-saved-as-BMP-gets-saved-as-a-24Bit-IMage-tp4671690.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]