can we use .jpg format images for mobile applications I.e iphone and android - iphone

i am working on mobile application where i need to display a background image using css sprites. here is the problem image size is 1600px width and 480px height. when i convert this image to png the file size is 400kb. and in jpg format it is 80kb.
So, my question is whether can i use the jpg format image in mobile application. especially in iphone and android........?
Thanks in Advance....

Yes
We can use jpg files BUT it is preferred to use png files as they are very lightweight to use.So as far as mobile apps are concerned png are the ones used.
Cheers

Related

iPhone graphics: format for photo with transparency?

I have some graphics I want to import into iPhone application. They are people / animals from photos that I cropped out that so they have transparent backgrounds. Obviously, I can't use JPEG as is traditionally recommended for photos because of transparency so what would be the second best option? I'm currently using png-24, but I assume that's too big. Is gif OK? Or something else?
It is recommended by Apple to use PNG whenever possible. PNG is still a compressed format so I think you'll be fine with respect to size.

why all suggest using PNG instead of GIF ,JPG images in iphone? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
When to use PNG or JPG in iPhone development?
I want to know why all suggest to use .png images instead of.jpg and .gif images for iphone applications. What is the problem when we use .gif or .jpg images. Is Apple doesn't support applications using non .png images. Please clarify me .
Thanks in advance
The iPhone is specifically optimized to handle PNG images very efficiently. It doesn't have the same optimizations for GIF and JPEG.
In addition, if you add a PNG file as part of your XCode project, then XCode will convert the PNG file into an Apple specific variant of PNG. There seems to be no official documentation about the format, but it is said to differ from the official PNG format in byte-swapping (BGR instead of RGB) and pre-multiplied alpha channels. These changes further reduce the amount of work the iPhone has to do at run-time.
Presumably because it supports an alpha channel for transparency, nicer for UI work.
.jpg is lossy compression and so has a different purpose than .gif and .png, which are lossless.
.png files support more colors than .gif and can be smaller, depending on the image. .gif used to be patent-encumbered but AFAIK those patents have expired.
.jpg is appropriate for larger images that need more compression than a lossless format can provide, especially real photos where artifacts of lossy compression will be less obvious. If the image is small or based on vector graphics where compression artifacts are obvious, lossless is preferred.

How to set high resolution images for iphone4 using css

In iphone4 images are not showing in high resolution its shows low resolution images.
How to change high resolution images for iphone4 using css?
To clarify, we are developing in phonegap using html and jquery The high-res images end up pixelated in the application. The .png images have the designation of #2x.png and the raw files match the png files.
We have utilized the practices in
http://aralbalkan.com/3331
and
http://davidehlers.com/2011/03/iphone...
The images appear slightly smaller than the raw images are, and significantly pixelated. I have attached an overlay of the issue that Venky is referring to. This is the buttonsml#2x.png on the right, placed on top of the screenshot of the app from an iPhone4.
Not sure about CSS but in normal way you can append "#2x" to normal image name and that would be goes for Retina Display. So may be you don't need to mention that in CSS and just put #2x in image and add it in to the project. For example for icon.png it would be icon#2x.png.
Hope this help.
I've gotten this to work by using the #2x versions in the image tags, and specifying a width/height that's half the size of the #2x image. For example, with a 200 x 80 "item#2x.png", I'd use:
<img src="item#2x.png" width="100" height="40">
It works well inside a UIWebView. Not sure about doing it with CSS though.
You have to use high resolution images. The SDK will automatically select the high resolution version (#2x) if you load the image in code (UIImage imageNamed), but if you are doing through any other method you will have to do it yourself.

Can i use a jpeg image for launching Screen

i was currently in to an app development and i have added a launcher screen in JPEG format which is displayed both in simulator and device .. but does it create any problem with apple approval guidelines ?
Update for iOS 8+: you can now use XIB-based launch assets, which is by far the best approach to reduce file size and re-use the same assets for multiple screens sizes. Also, since XIBs support JPG assets, you can always embed JPGs onto XIB files now too!
The Apple documentation pre iOS 8 (now removed), explicitly stated that only PNG is allowed for the launch image:
App Launch (Default) Images
Every app must provide at least one launch image. This image is
typically in a file named Default.png that displays your app’s initial
screen in a portrait orientation. However, you can also provide other
launch images to be used under different launch conditions. All launch
images must be PNG files and must reside in the top level of your
app’s bundle directory. (Avoid using interlaced PNGs.)
I can't speak to how accurate this document is, but it seems they are pretty specific on this point.
My advice: use 8-bit PNG's, and if your files are getting to big, simply don't include the #2x versions for the retina iPad. The 1x version upscales reasonably well on the retina iPad, and better than bloating your app by 5MB+
Yes ofcourse you can use JPEG image in Launch screen or anywhere in project.NO it absolutely does not create any problems in approval process of Apple.So go ahead and code!
Use a png if you can; not only is png artwork better visually, but iOS is optimised for png files.
While it is true Apple won't reject your app for using a jpeg, your users might.
NO you should not use jpgs
Here are apple recomendations
Note: For all images and icons, the PNG format is recommended.
The standard bit depth for icons and images is 24 bits (8 bits each for red, green, and blue), plus an 8-bit alpha channel.
You do not need to constrain your palette to web-safe colors. Although you can use alpha transparency in the icons you create for navigation bars, toolbars, and tab bars, do not use it in application icons.
You can only use PNG files for the launch images. Here is the proof.
Yes , you can choose any one from JPEG/PNG.There is no guidelines from apple to choose type of image.
For more information you can follow apple launch image guidelines.
but I assume that PNGs are more preferable because Apple seems to use PNGs virtually everywhere in iPhone OS.

How can I load vector image directly with iPhone SDK?

How can I load vector image directly with iPhone SDK? Just as UIImage loads bitmap images.
I did this recently using PDF. I saved some resolution independent images directly from Illustrator (using the smallest file size preset). I have some code (gists) here.
As of iPhone OS 2.1, the iPhone's WebKit supports SVG graphics natively. You should be able to use a UIWebView to load the SVG element for display. This question provides some sample code for doing so.