MohitPandit
asked on
C#.NET (Graphics): Image properties removed when converting object of Image type to Bitmap type.
Hello Folks,
In .net application when image is processed & merged with another image then its colors are affected.
Image image ---------> Uploaded image
So the “image” object has few “PropertyItems” and when we convert image to Bitmap type of object then these “PropertyItems” array is empty, that means these “PropertyItems” were not moved in this conversion.
Please find below snap shot before before move to Bitmap object.
Now after this image is moved into Bitmap object for resize purpose and “PropertyItems” array is empty
Actual Image
After processing through Bitmap
Note: This image is captured through Canon DSLR camera.
Questions
1. What is the reason behind that “PropertyItems” array is empty when convert image to Bitmap type of object.
2. How these properties can be managed when I need to merge two images (using “Graphics” class) and I don’t want forcefully to apply one image’s “PropertyItems” on to other image, to keep original colors of each image respectively.
3. What is the real solution to merge two different images with different quality and PropertyItems with each other and produce quality end result image.
4. Do you any other thoughts?
Best Regards,
Mohit Pandit
In .net application when image is processed & merged with another image then its colors are affected.
Image image ---------> Uploaded image
Bitmap xy = new Bitmap(image, image.Width, image.Height); -----> Conversion into Bitmap to
perform various operations like resize or merge with another imageSo the “image” object has few “PropertyItems” and when we convert image to Bitmap type of object then these “PropertyItems” array is empty, that means these “PropertyItems” were not moved in this conversion.
Please find below snap shot before before move to Bitmap object.
Now after this image is moved into Bitmap object for resize purpose and “PropertyItems” array is empty
Actual Image
After processing through Bitmap
Note: This image is captured through Canon DSLR camera.
Questions
1. What is the reason behind that “PropertyItems” array is empty when convert image to Bitmap type of object.
2. How these properties can be managed when I need to merge two images (using “Graphics” class) and I don’t want forcefully to apply one image’s “PropertyItems” on to other image, to keep original colors of each image respectively.
3. What is the real solution to merge two different images with different quality and PropertyItems with each other and produce quality end result image.
4. Do you any other thoughts?
Best Regards,
Mohit Pandit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Exif properties helped a lot for my custom logic.
Glad I could help :)
ASKER
Best Regards,
Mohit Pandit