[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saving a NxM matrix as a color-mapped image of size NxM
From: |
lynx . abraxas |
Subject: |
Re: saving a NxM matrix as a color-mapped image of size NxM |
Date: |
Wed, 12 Dec 2012 13:44:15 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Dear James,
Many thanks for Your hint.
On 11/12/12 16:45:18, James Sherman Jr. wrote:
> I think the problem is that your original image (mHist2d) is of type
> double, but imwrite expects type uint8, so what happens if you try:
>
> imwrite(uint8(mHist2d), colormap(cmap), "test.png", "png");
True. It seems that the hist values have to be between [1;256] and only [1;256]
from cmap are used.
Attached is a small test script in case someone has the same problem.
Many thanks again
Lynx
test_save_imagesc_01.m
Description: Text document