TIFF 204x98 DPI screen dimensions - jpeg

i've TIFF page (Fax low resolution G4 CCITT.6) with this properties:
H:1146
W:1728
HResolution: 204 DPI
VResolution: 98 DPI
Bit : 1
When i view this in tiff viewer, the image is ok.
When i convert this in JPEG the image is stretched.
Only "Image & Fax Viewer" of windows show me correct TIFF and JPEG (Ms Paint Not)
What is a formula for calculation of Width and Height in pixel to show not stretched image?
Thanks
This is output image JPEG:
Edit:
Uploading image, the site convert it in 96x96DPI of h&v resolution...

Related

Does PIL ImageEnhance library supports 16 bit JPG images

I am trying to save and display 16 bit JPG image. but getting error like
image has wrong mode
.
If Supported, then what will be the mode?
Check this
The mode (this is a string specifying the pixel format used by the image) of an image defines the type and depth of a pixel in the image. The current Python Imaging Library release only supports the following standard modes:
1 (1-bit pixels, black and white, stored with one pixel per byte)
L (8-bit pixels, black and white)
P (8-bit pixels, mapped to any other mode using a colour palette)
RGB (3x8-bit pixels, true colour)
RGBA (4x8-bit pixels, true colour with transparency mask)
CMYK (4x8-bit pixels, colour separation)
YCbCr (3x8-bit pixels, colour video format)
I (32-bit signed integer pixels)
F (32-bit floating-point pixels)
This may be the reason you are getting the above error.
The Image.convert method creates, from an existing image, a new image with a given mode.
To know more about image attributes check the link and about full concept check the link.
Hope this helps you.

SVG icons from PNG

I need to convert PNG icons into SVG format. What size should the initial PNGs be? Do I need to make the icons smaller (they will be 30 x 30 px on the site) before I save them as SVGs?

jpeg binary file header with inverted width & height

I am calculating a jpg file size by parsing it as a binary file with nodejs.
But the computed width height gives 4032x3024 when the actual size is 3024x4032.
Its header 0xFFC0 block is as follow:
ffc0 0011 080b d00f c003
According to JPEG format, sizes should be :
height = 0bd0 (i.e:3024)
width = 0fc0 (i.e:4032)
(Using Imagemagick identify program confirms this calculation:
identify HJ7XFd9le.jpg
HJ7XFd9le.jpg JPEG 4032x3024 4032x3024+0+0 8-bit sRGB 380KB 0.000u 0:00.000)
But when viewing the image in my mac viewer, the inspector indicates a size of 3024x 4032!
How can i compute the correct size programmatically by parsing the file as a binary file?
Thanks!
Ah - it's not that the size is inverted, it's that you need to respect the EXIF orientation (rotated 90/270). The sensor is in a certain orientation and if you capture the image rotated, the camera software may signify the change by putting a non-0 orientation in the APP1 EXIF data. – BitBank

Free image RGB and BGR

I'm using FreeImage to load a jpeg and a tiff.
The jpeg is 24-bit (8 bpp). The tiff is 48-bit (16 bpp).
Problem is, FreeImage loads the jpeg as BGR, and the tiff as RGB.
How can I distinguish between the 2 so I can render it to the screen properly?

Google Earth adds random black rectangles to my transparent png overlay - how to avoid this in either png creation or kml?

Viewing the PNG in an image viewer, it is normal.
Viewing the PNG as an overlay in Google Earth, random black rectangles are added near the transparent regions of the image.
How to avoid this in either PNG generation or in KML?
The PNG is BufferedImage.TYPE_4BYTE_ABGR

Resources