The photos taken on iPhone 5 appear grainy after being transported to a computer. Could this be a result of accidental compression?
I don't know what kind of graininess you see, but one kind of graininess is usually called noise. You should really study the basics of photography and what noise is.
Light consists of photons, units of light. The lens can't have 100% transmittance, so only certain percentage of light goes through the lens. Furthermore, the lens has an aperture to control the depth of field, so with a small aperture you have little light reaching the sensor. The Bayer filter filters away some of the light, too, and sensors can't have 100% quantum efficiency. So, all of this means you are lucky if even 10% of the photons reaching the lens result in the color of a pixel changing.
Also, there's electronic noise. When reading the pixel charges, some amount of thermal noise is always present and can't be filtered away by the electronics.
Furthermore, iPhone is small. It can have only small sensor, small aperture and small focal length. You can't have good optics in a pocket form factor. For this reason, an iPhone has a lower ability to collect light than let's say a full frame digital single lens reflex camera.
There are various noise reduction algorithms, but they (a) remove some of the detail in the image too in addition to removing noise and (b) can't remove all of the noise. Chances are your image has already noise reduction applied, but the results don't satisfy you.
The only way to get less noise is to have more light in the scene (natural lights, flash), or a better ability to collect light (ditch the iPhone and purchase a good digital single lens reflex camera along with an image stabilized and/or large-aperture lens). Or both!
If you don't want to get rid of iPhone, you can try mounting it on a tripod and using long exposure time if the subjects don't move. I'm not sure if this works, because I haven't used an iPhone camera. At least on my mobile phone camera, I can adjust the exposure time.
Note the flash of iPhone is very low intensity, so you can't expect miracles.
It's normal for the defects in any photo to be more obvious when they are viewed on a much larger screen than when they are viewed on a much smaller screen. This applies to what we call image noise, which some people describe as "graininess", as well as to overall image resolution (in pixels), which can make lower resolution images look "blocky" when stretched to fill higher resolution screens.
The iPhone 5 has a screen resolution of 1136x640 pixels in a 4" diagonal screen. That translates to 326 ppi (pixels per inch). A typical 24" HD monitor has a resolution of 1920x1080 pixels in a 24" diagonal for about 96 ppi. This means the details of an image are much larger when viewed on a 24" screen than when viewed on a 4" screen.
If the dimensions of the image file, in pixels, are less than the dimensions of our screen, in pixels, then you'll also see the effect of those fewer pixels being stretched to display on the larger screen.
You haven't said exactly how you are transferring the pictures from your iPhone 5 to your computer. Some ways of transferring images from mobile devices also reduce the image size, in pixels, or use higher image compression, to make the file size smaller so the transfer doesn't take as long or require as much bandwidth.
If you are transferring the images via e-mail or text messaging from the iPhone 5 using the default applications and settings, the images are reduced to a much smaller size than the native 3264x2448 pixels that the images have when stored and viewed on your phone.
I guess they have to look like that in a big screen because of some factors I pass to explain you next.
There is many factors here that play an important role and I'd say screen size, sensor size and megapixels are playing a key part.
It is not the same to see a 1mb image in a 4 inches screen that in a 20 inches screen. Even less if the sensor that captured that image is smaller and captures less ppts.
Usually what you see in a small screen doesn't look same in a bigger one. Specially talking about smartphones. The big difference between smartphones and Dslr cameras are sensor sizes. The mobile phone might use a smaller one iPhone 5 Sensor Sizes with less resolution, creating a smaller image with less points on it.
Check also that link that compares different sensor sizes to understand better what and how does the sensor size helps or not in getting better quality in the images.
Please check this table about how big images can you print depending on the size of your files
Please notice that the author talk about 12bit RAW files size. iPhone produce JPEG files
MP RESOLUTION FILE SIZE HI-RES PRINT NORMAL PRINT 2 1600x1200 ~ 2MB 5" x 4" (13cm x 10cm) 10" x 8" (27cm x 20cm) 3 2048x1536 ~ 3MB 7" x 5" (17cm x 13cm) 13" x 10" (35cm x 26cm) 5 2560x1920 ~ 6MB 8" x 6" (21cm x 16 cm) 17" x 13" (43cm x 32cm) 6 2816x2112 ~ 8MB 9" x 7" (24cm x 18cm) 19" x 14" (48cm x 36cm) 8 3264x2468 ~ 12MB 11" x 8" (28cm x 21 cm) 21" x 16" (55cm x 42 cm) 12 4000x3000 ~ 18MB 13" x 10" (34cm x 25cm) 26" x 20" (68cm x 50cm) 24 6048x4032 ~36MB 20" x 13" (51cm x 34cm) 40" x 27" (100cm x 68cm)
This table was taken from this link.
As you can see the phone sensor compared to any professional cameras is super small, and also is its resolution, way smaller than any professional camera. Megapixels are NOT everything in life, but is well known that an image sized small can't be converted into a big print. And the same is happening with your computer's screen. Mobile phone cameras are made to make images look great on your mobile phone's screen (which would not be bigger than 6 inches), so anytime you try to export them into bigger screens might be that the sensor and resolution of the image are too low for the screen you are trying to watch it in. Normally this is what happens.
Of course with time smartphone cameras are getting better and better but let's not forget that we are focusing our thoughts about an iPhone 5 camera and images.
This is one of the reasons why nobody does shoot (or mainly nobody) professionally with smartphones, because if you need to print in big sizes or use your images for professional websites and so on, the quality that smartphones will get (specially older ones like an iPhone 5) are not even close to what is needed to do those prints or use the images on a website.