Background color issue with TIF file in XP - image

I have an issue with a image file on XP and windows 7 but it works perfectly in windows 2008 box. Coming to the actual issue, the TIF image in the question is a Invoice form image with a white background with Invoice details. When I open it in 2008 it opens with white background but when I open it in XP and Windows 2008, it turns to black background with white color text. I am seeking some help on this issue.
1. Is it a OS issue
2. if it is a OS issue, how do I change the background color to white using any code preferably C# as I am using C# for developemnt.
Thanks in advance
Satish

Simply we can interchange the Palettes then Issue will be resolved by this...
Dim plet As ColorPalette = Image.Palette
plet.Entries(1) = c1
plet.Entries(0) = c2
Image.Palette = plet
But struck at identifying the Images that are having problem, i.e. because we have to apply this to the Images that are having Issues only. Otherwise correct images also inverted.

Could be a CMYK or transparency issue, or that it's saved in 16-bit color format (per component).
But this is hard to determine without access to one actual file for analysis.
Update:
Problem 1: For TIFF files - on Windows XP the Photometric tag is ignored by Windows Photo viewer and its underlying technology, with TIFF files using a single bitplane (2 colors). This is a bug.
Solution 1a: Manually enter (switching for existing) palette entries to force bit 0 (off) black and bit 1 (on) white.
Solution 1b: Save files as RGB files /gray-scale would be more ideal, but in GDI+ there is no good support for 8-bit gray-scale files IMO).
Problem 2: Byte-order. On Windows XP, the byte-order (big-endian) can cause problems. Normally TIFFs are saved in Motorola big-endian format (MSB) but on Windows XP the TIFF file is assumed to be in little-endian format.
Solution 2a: Save new TIFF files with little-endian order (Intel) for new files
Solution 2b: If Re-saving (re-scanning) is not an option for existing files, re-order content for existing files switching byte-order from LSF (Intel) to MSF (Motorola). Update header to indicate new byte-order (replace II for MM etc.).

Related

Warning: Input PNG does not have an 8 bit input depth. Please convert your PNG to 8-bit for optimal performance on iPhone OS

I started using the ionicons_2-0-1_ios-pause-outline and
http://fa2png.io/r/ionicons/
to convert these to the correct size.
However when I try the iOS iPhone 7 simulator I get this message:
Warning: Input PNG does not have an 8 bit input depth. Please convert
your PNG to 8-bit for optimal performance on iPhone OS
How can I convert icons to png with the correct depth?
Your images are not in 8-bit, images need to be in 8-bit, not 16-bit.
That goes for the icon as well. and iOS only supports 8-bit images as well.
8-bit means 8-bits per color channel, which is 16.7 million colors.
16 bits per channel give 32,769 colors per channel, which is actually 281 trillion possible colors! 16-bit is only used for photo editing,
images still need to be saved back down to 8-bit for printing.
MakeAppIcon is useful website for generating App icons. and IcoFX is a fantastic tool for creating 8-bit depth icon.
The main difference between an 8 bit image and a 16 bit image is the amount of tones available for a given color. So your image has too many colors in it. Here's a list of some applications that can solve this problem for you. http://myappmag.com/make-windows-icons/ from that list; Number 5 seems to be a good option.
Also this can help you find a color within the 8-bit range.
http://neildowning.com/HEX_to_RGB_color_converter.php
Looks like Xamarin requires 8-bit per color channel
(8-bit for Red, 8-bit for Green, and 8-bit for Blue)
http://forums.gamesalad.com/discussion/comment/61399/#Comment_61399
That is called "true color" which is actually PNG-24 (because 24 = 8*3)
https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29
So why don't we run a python script to do that for us.
If you are not familiar with python, all you need to do is
Download Python (make sure you add pip to your path during setup)
run pip install pillow in the cmd (Run as Administrator if says Access is denied)
. Pillow is an imaging library for python.
Make a file in the folder with your images, call it convert.py
Put the following in it
def convert_to_24(image_file):
from PIL import Image
try:
im = Image.open(image_file)
except(FileNotFoundError):
print(image_file ,"was not found.")
return
print(image_file,"is in",im.mode,"mode.")
if im.mode != "RGB":
im = im.convert("RGB")
im.save(image_file.split('.')[0]+"_24.png")
return
if __name__ == "__main__":
convert_to_24(input('Enter image file name:'))
Open cmd where the script and the images are and type python convert.py
When it asks for the file name, put the file name including the extension, like filename.png
It will tell you in what mode the image was, and will create another image with a name filename_24.png that has 8-bit color pixels (aka 24bit png).
How can I convert icons to png with the correct depth?
Convert to jpg and back to png. That will also remove the alpha (transparency) channel.

How computer stores images or videos as data, and where, can i make operations on it?

You know, computer stores images as channels and pixels in those channels. And pixel values are like "00110101" which fills 8 bits at memory. I want to know truly where that bits stored at memory, and how can i make operations on them.
Thanks!
Well, the standard book is Digital Image Processing by Gonzalez and Woods.
Another book, where you can pick up the PDF for free is Image Processing in C by Dwayne Philips - PDF here.
First, you need to get a decent C compiler and development system - personally I use Mac OSX, but I guess you would want Visual Studio free edition on Windows.
Then you need to get started with some simple reading and writing of files and memory allocation. I would go with greyscale images of the NetPBM format - probably just PGM files - described here as they are the easiest. You can download the NetPBM programs and run them in a Windows Command Prompt and see how they work and try and implement them yourself in C. You can also download ImageMagick for Windows and try converting images from colour to greyscale and resizing them like this:
convert input.png -colorspace gray result.jpg
convert input.tif -resize 400x400 result.pgm
When you have got that, I would move on to colour PPM format and then maybe PNG and/or JPEG. Remember there are libraries for TIF/JPEG/PNG/BMP so don't be afraid to use them.
Finally, move on to displaying images yourself with Windows GDI etc.
Come back to StackOverflow if you get stuck - questions are free!
tl;dr wildly different with different encodings/filesystems/os'es/drivers
Well that depends on the image format. BMP is one of the easier formats, details on what these files look like can be found on for instance wiki
And to answer "where its stored", it is stored on permanent storage (hardrive/ssd), where exactly depends on the filesystem (FAT/NTFS/EXT etc).
When an image is to be displayed, its read into memory, where it can be manipulated and through some apis this data can be put into a memory region specifically meant to display the current images on you screen.

Creating a png with specific rgb values (mac)

I'm using a Mac. When I try creating a png with specific rgb values (i.e. 128,0,0), this is fine (I've tried using both GIMP and photoshop).
Now when I open the png file, the color looks slightly different. And when I use the DigitalColor Meter, the rgb values don't match anymore (the 128,0,0 file became 106,7,0).
What's going on?
Thanks
I tried you steps in Gimp under WinXP and do not see any difference.
When you save PNG file do you set some conversion options?
Update:
This link have same more info about color management on Mac OS X and may be a solution for you problem: Color management.
My guess is that you have problem with default color management applied in Mac.

Image that doesn't show up in IE or Chrome only

I have a jpeg that shows up properly in FF, but won't appear in IE or Chrome. I tried downloading the image and loading it in IE and Chrome directly without success: both browsers shows a broken icon. So this is not a network issue.
This file is a result of an image resize by javax.imageio.ImageIO. I have processed over 1000 images successfully.
Windows explorer shows the thumbnail properly, and I can edit it successfully in Microsoft Office Picture Manager.
Is there any tool that could help me understand what is wrong with this file?
My guess is it's a CMYK JPG. Change it to RGB.
I had the same issue several times (mostly in IE 6 and 7).
Two things I've notice (except the colorspace CMYK / RGB, witch is the first thing to look for):
Even in Photoshop, when I changed the colorspace ("mode" in PS), and re-saved the image, often the change didn't seem to stick. So I often find it easier to do a copy/paste in a fresh new RGB 8 bit document.
Also, those images usually came from a Mac PS while I was working on a PC (or vice-versa) so something regarding RGB Mac/PC colorspace seems to be at stake here.
I had a similar issue and thanks to twlichty for the correct answer to my issue. The file was a CMYK jpg format.
But I needed to keep it in CMYK as we are printing off the image as a looped background for office awards. As a solution I worked of the OP's final solution and I changed the image to PNG. I turned off Transparency as it was not needed and I unchecked Convert to sRGB to keep it in CMYK. This then created a CMYK image with a PNG wrapper that Internet Explorer was capable of printing. The final image colors look spot on as well.
Just wanted to leave my own issue and fix found related to this topic for others.
Cheers.
batty13
If all you want to do is fix this one image and move on, I imagine you could fix it by simply writing it out with a different tool, perhaps after making a trivial change.
You need a library/class that supports CMYK, otherwise all you get is an error or, even worse, all you get is an unreadable pictures.
Look your documentation for references to "Colorspace".

JPEG Shows in Firefox but Not IE8

I'm working on a Sidebar Gadget and cannot get my JPEGs to show up (PNGs work). When I try to open the file by itself in IE8 it doesn't work. Firefox, of course, can open it fine.
JPEG Details:
Dimensions: 1080X900
180 dpi
Bit depth 24
Color representation: uncalibrated
I've found some things talking about the images being compressed incorrectly (?) but I haven't been able to get it working...
Any clues?
IE8 drops support for CMYK JPEG and renders them as the infamous red X without so much as a warning.
If you have ImageMagick:
identify -verbose image.jpg
will show you the image colorspace. If it's CMYK, you can convert to RGB with:
convert broken.jpg -colorspace RGB fixed.jpg
If you need to do CMYK to RGB conversion on a whole batch of JPEG-images, this command may be helpful to you:
for i in *.jpg; do convert "$i" -colorspace RGB "$i"; done
PS: If you'd like to see what is going on, just add -verbose:
for i in *.jpg; do convert "$i" -colorspace RGB -verbose "$i"; done
I had a similar issue with IE8 not displaying two JPEG images. FF, Safari, Chrome all displayed them without complaint but IE acted as if the files were not there. I have no idea what was going on, but a quick image conversion to gif or png fixed the problem. Just another in a long line of confirmations that IE sucks.
Had similar problems with existing images, which will not show up in IE8.
Problem is, as converter42 says: CMYK-Images
Convert them to RGB colorspace and all is good
The Solution with the PNG is not the best, because PNG files can be MUUUCH larger than JPGS.
If you are using photoshop for creating the jpgs. Try the below.
Open the file and go to 'Image' menu
Go to Mode
Select RGB
Save and upload to server.
This should work.
Why are you dealing with the image at 180 dpi and not the 72dpi screen resolution? At screen resolution the image will be roughly double that size. Still, the size is manageable for any browser.
When creating a gadget, you should be using PNGs for all the elements of the gadgets. Are you having issues displaying JPEG photos?
Have you looked for the yellow bar at the top of IE that blocks certain suspicious content from being loaded (popups, activex, javascript, etc.)? If it appears, try telling it to "allow".
Lastly, what are you using to compress your images to JPEG?
EDIT: If you want to do batch conversion use the batch converter in photoshop or use the Actions panel to record the conversion process for a single image, then replay the action on an entire folder. Additionally, you can save this action to a "droplet" which is a small application containing the action that you can drop an image or folder on top to.
Alternatively, if you don't fell like learning Actions, XNView is an excellent image viewer and converter that supports something like 160 different image formats and can batch convert and batch rename huge lists of files.
I fixed this issue by opening the CMYK JPEG file in Windows Paint and then saving as a JPEG, which Paint encodes as RGB by default. Not a great solution because I'm sure that Paint's converter is not as robust as Photoshop's, but this can be a quick fix if the job needs to be done now and there's no access to the tools above.

Resources