[PySide] Does isGrayscale() can tell whether a color image cansafely be converted to a grayscale image?

Tim Doty thoromyr at mac.com
Tue Jan 14 13:34:50 CET 2014


On Jan 14, 2014, at 5:43 AM, iMath <2281570025 at qq.com> wrote:

>  if an image only contains gray colors, is there still any need to  convert it to a grayscale image?
> BTW,I think an image only contains gray colors is a grayscale image.

There is a difference is how much space it takes up: 1 byte per pixel for a grayscale and 3 bytes per pixel for a color image that happens to be comprised of only shades of gray.

And its been a little since I looked at it, but IIRC Qt has different functions between color and gray scale images. Certainly, palette based image objects have different functions.

Tim Doty

> 
> 
> ------------------ Original ------------------
> From:  "Sean Fisk";<sean at seanfisk.com>;
> Date:  Tue, Jan 14, 2014 11:09 AM
> To:  "iMath"<2281570025 at qq.com>;
> Cc:  "pyside"<pyside at qt-project.org>;
> Subject:  Re: [PySide] Does isGrayscale() can tell whether a color image cansafely be converted to a grayscale image?
> 
> I would presume that if an image only contains gray colors, it can be safely converted to a grayscale image. Since allGray() and isGrayscale() indicate the former, that would also mean they indicate the latter.
> 
> 
> 
> --
> Sean Fisk
> 
> 
> On Sun, Jan 12, 2014 at 6:21 AM, iMath <2281570025 at qq.com> wrote:
> In the Image Formats part of QImage doc says
> "
> The allGray() and isGrayscale() functions tell whether a color image can safely be converted to a grayscale image.
> "
> but in the doc of there 2 functions indicate they're used to decide whether an image is grayscale image ,not mentioned they could be used to tell whether a color image can safely be converted to a grayscale image.
> 
> what about your opinion ?
> 
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside
> 
> 
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside




More information about the PySide mailing list