how to make JPG image transparent background? - image

As we all know that jpg image format does not support transparency.
so we use .png format.
i was surfing on net and i found an image with .jpg format and
transparent. it is wonder how a jpg format image can be transparent.
here is the example image.
http://bdthemes.net/demo/joomla/intensy/images/sampledata/features/top_b.jpg

The provided example image is in fact not a JPEG, but a png file.
It has the extension and mime-type of a jpeg file, but it's contents are in png format.
JPEG file format does not support transparacy.
So if you need transparancy in images for use in browsers.
You can either:
convert the image to png, this works in all browsers
use ZorroSVG, requires SVG support but results in smaller files for photographic images.
use webp, only use when you have fallbacks in place for browsers that do not support webp.

The new JPEG-XR standard supports transparency.
However, this is not a real JPG, it's a PNG. If you rename it to .txt, you can see that the contents of the file start with PNG:

check its mime type, it must be renamed .png to .jpg

Related

How do I find the jpeg header in a compressed image with jpeg

I have five compressed images and I need to find raw data from these images. That's why I have to find out the Jpeg heading. but the header of each image is different.I think jpeg doesn't have a fixed header like bmp etc.
JPEG does not define a header or a file format at all. There are several jpeg file formats in use, notably JFIF, EXIF, SPIFF, and Adobe.
The formats define APPn markers that are expected to appear after the SOI marker. However, most decoders will try to figure the image out without these headers.
You do not need a header to find the image data. You scan the stream for JPEG markers.

Can a PNG image contain multiple pages?

On OSX I converted a multi-page PDF file to PNG and (somehow) it created a multi-page PNG file.
Is there an extension to the PNG format that allows this? Or is this not something I can validly create?
~~~~
To clarify, this is a PNG file, per the builtin file command and the identify command from imagemagick.
$ file algorithms-combined-print.png
algorithms-combined-print.png: PNG image data, 1275 x 1650, 8-bit/color RGBA, non-interlaced
$ identify algorithms-combined-print.png
algorithms-combined-print.png PNG 1275x1650 1275x1650+0+0 8-bit sRGB 3.537MB 0.000u 0:00.000
And here is a pastebin of the command identify -verbose algorithms-combined-print.png: http://pastebin.com/hw1yuRKa
What is notable from that output is that the pixel count is Number pixels: 2.104M which corresponds to one page. However, the file size is 3.537MB, which is clearly sufficient to hold all the pages.
Per request, here is the output of pngcheck: http://pastebin.com/aCRMEd9L
PNG does not support "multipage" images.
MNG is a PNG variant that supports multiple images - mostly for animations, but it's not a real PNG image (diffent signature/header), and has never become popular.
APNG is a similar attempt, but more focused on animations - it's more popular and alive, though it's less official - it's also PNG compatible (a standard PNG viewer, unaware of APNG, will display it as a single PNG image).
Another possible explanation is that your image is actually a TIFF image with a wrong .png extension, and the viewer ignores it.
The only way to know for sure is to look inside the image file itself (at least to the first bytes)
Update: given the pngcheck output, it seems to be a APNG file.

Thumbnail Image and JPG

First I'll start with my assumptions about thumbnail:
Thumbnail is the same image reduced by size so it is smaller in size and faster to load
In Exif data there is referance to Thumbnail Image so it might be part of the jpg file
Now what I think is that theoretically I can "inject" to a jpg file another thumbnail so that in windows i will see a small picture and when I will open the file I will see other picture
And my question is in guidlines how do I do that?
Thanks!
Some JPEG file format support including a thumbnail as part of the image header. In the JFIF format, the thumbnail can be either an RGB bitmap or a nested JPEG stream.
You need a JPEG encoder that will insert a thumbnail into the JPEG header. It's that simple. ImageMagic will do it. Many other JPEG encoders will do it as well.

The best image file format for TEXT and tools to make it

Need to convert pdf file to image file (jpg, png, gif) to show on the web.
Exploring goole application to that reads PDF files shows that they are using PNG. But hov to onvert 2000x2000 file so it have only 150 kb?
Is there any command line tool?
PNG and GIF are better than JPEG, GIF probably better than PNG. TIFF usually is the best.

If i am making a image sharing service website using the standard file upload form what images can i say it supports, other then jpg, png, gif

If i am making a image sharing service website using the standard file upload form what images can i say it supports, other then jpg, png, gif. Is there a list that shows what browsers supports what? I know that jpg png and gif are most common but what are the others. I want to be sure.
Honestly, that's pretty much all you should be concerned with. Any other file formats (like svg) are not widely supported enough.
I would suggest converting other types of files to those 3
Examples:
jpeg (simple renaming)
bmp
tiff
pcx

Resources