Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2006

Tip: Looking for answers? Try searching our database.

Tinting occurs when reading/writing Bitmap - Why?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lee Gillie - 22 Mar 2006 22:39 GMT
I am reading a TIF file which is 24bpp, and writing a JPG which is also
found to be 24bpp with code very close to that shown below. In the
process the deep red TIF colors are being transformed into a ruddy rust
in the jpg, and the blue highlights are being subdued. Color is not
being transformed radically, such as green for red, for example, it is
more subtle. It is almost as if a tint were being applied. How can I
elminate this color transformation?

Dim InBmp As Bitmap = New Bitmap(InputFileName)
Dim OutBmp As Bitmap
OutBmp = New Bitmap(InBmp, Width, Height)
OutBmp.Save(mOutputFileName(idx), ImageFormat.Jpeg)

Any hints would be greatly appreciated.
Lee Gillie - 23 Mar 2006 00:59 GMT
> I am reading a TIF file which is 24bpp, and writing a JPG which is also
> found to be 24bpp with code very close to that shown below. In the
[quoted text clipped - 10 lines]
>
> Any hints would be greatly appreciated.

I think the problem occurs when reading the TIFF:

Dim InBmp As Bitmap = New Bitmap(InputFileName)
InBmp.Save("Test1.jpg", ImageFormat.Jpeg)

Dim InBmp As Bitmap = New Bitmap(InputFileName, True)
InBmp.Save("Test2.jpg", ImageFormat.Jpeg)

Dim InBmp As Bitmap = New Bitmap(InputFileName, False)
InBmp.Save("Test3.jpg", ImageFormat.Jpeg)

Dim InBmp As Bitmap = New Bitmap(InputFileName, True)
InBmp.Save("Test4.tif", ImageFormat.Tiff)

Dim InBmp As Bitmap = New Bitmap(InputFileName, False)
InBmp.Save("Test5.tif", ImageFormat.Tiff)

And even using the EncoderParameters for jpeg to set quality to 100 all
exhibit the same drop in color saturation.

Interestingly, upon reading the Tiff file, the BitMap object says the
pixel format is Format32bppArgb, even though Irfanview tells me this
Tiff format file is 24bpp.  Is the difference between 32/24 a luminance
or brightness, or saturation plane? Could it be that BitMap is reading
the file and implying saturation data this is simply not there?

If so, I wonder what I can do about it?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.