From: Diyana Zaki on
Hi Ben,

I'm also facing the same problem as yours. How do you solve this prob?

Thanks,
Diane

"Ben Williams" <supern3t(a)gmail.com> wrote in message <h7h4cr$b32$1(a)fred.mathworks.com>...
> maybe i found what's the source of my problem.
>
> when i use imshow, i specify a range of grayscale in this way:
> imshow(A, [0 4096])
>
> but, in imwrite i don't know how to specify this information. how can i do?
From: ImageAnalyst on
On Feb 28, 9:32 am, "Diyana Zaki" <L_C...(a)yahoo.com> wrote:
> Hi Ben,
>
> I'm also facing the same problem as yours. How do you solve this prob?
>
> Thanks,
> Diane
-----------------------------------------------------------------------------------------------
Diane:
What form is your data in? Double? Single? uint8? int16? int32?

What form do you want to store your data in? Would you be willing to
save it to uint8, which seems to be the most universally accepted and
reliable way of saving it if you simply want to view it later? Or do
you need to retain the original bit depth for later analysis?
From: Diyana Zaki on
Hi,

It's in <512x512 double> , min_value=0 and max_value=2190 .
I wanna save the current figure as .jpg after:
figure, imshow (a, [2066 2190]);

& also want to retain the original bit depth & image size (512x512) for later analysis .

Thanks!

ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <b60818ee-95a9-474b-af66-b8f9832f6d57(a)g26g2000yqn.googlegroups.com>...
> On Feb 28, 9:32 am, "Diyana Zaki" <L_C...(a)yahoo.com> wrote:
> > Hi Ben,
> >
> > I'm also facing the same problem as yours. How do you solve this prob?
> >
> > Thanks,
> > Diane
> -----------------------------------------------------------------------------------------------
> Diane:
> What form is your data in? Double? Single? uint8? int16? int32?
>
> What form do you want to store your data in? Would you be willing to
> save it to uint8, which seems to be the most universally accepted and
> reliable way of saving it if you simply want to view it later? Or do
> you need to retain the original bit depth for later analysis?
From: Tombo H on
On Feb 28, 10:35 pm, "Diyana Zaki" <L_C...(a)yahoo.com> wrote:
> Hi,
>
> It's in <512x512 double> , min_value=0 and max_value=2190 .
> I wanna save the current figure as .jpg after:
> figure, imshow (a, [2066 2190]);
>
> & also want to retain the original bit depth & image size (512x512) for later analysis .
>
> Thanks!
>
--------------------------------------------------------------------------------------
So what's the problem? Do you want to save the figure, or the image?
A figure contains an axes which contains an image. I've never tried
to save anything other than a uint8 image as a jpeg so I can't say if
that will work or not - you'd have to check the documentation. In
general you use imwrite() but you're going to have to be more specific
if you want help. Generally imwrite() works so if it's not working
for you, you'll have to show us your code and your error message or
explain in more detail what's not working the way you want it to.
From: Diyana Zaki on
yeah, i think its ok to get an uint8 image. I want to save the image in the current figure as .jpg .. The image contains useful pixel information within a range of [2066 2190]. basically, there is no error displayed but, the image are not successfully saved.

I wrote:
....
figure, imshow(a, [2066 2190]);
imwrite (gcf, 'try.jpg', 'jpg'); % I want to retain the original size of an image <512x512>
...

&& Ive also tried:
saveas(gcf,'try.jpg', 'jpg'), but the result was a jpg image with different size - 900x1200x3 uint8 .. Is there any way to get the result with its original size? 512x512. Please advice.

Thank you for your kind help.







Tombo H <tombo.hayworth(a)gmail.com> wrote in message <6013fc58-dd46-46e3-8c7a-2bec167766cb(a)f35g2000yqd.googlegroups.com>...
> On Feb 28, 10:35 pm, "Diyana Zaki" <L_C...(a)yahoo.com> wrote:
> > Hi,
> >
> > It's in <512x512 double> , min_value=0 and max_value=2190 .
> > I wanna save the current figure as .jpg after:
> > figure, imshow (a, [2066 2190]);
> >
> > & also want to retain the original bit depth & image size (512x512) for later analysis .
> >
> > Thanks!
> >
> --------------------------------------------------------------------------------------
> So what's the problem? Do you want to save the figure, or the image?
> A figure contains an axes which contains an image. I've never tried
> to save anything other than a uint8 image as a jpeg so I can't say if
> that will work or not - you'd have to check the documentation. In
> general you use imwrite() but you're going to have to be more specific
> if you want help. Generally imwrite() works so if it's not working
> for you, you'll have to show us your code and your error message or
> explain in more detail what's not working the way you want it to.