The Image

Camera images are generally measured in size (mega-pixels)
This determines the file size and the print size from camera.
It does not determine the quality.

A good lens is important on any camera to obtain high quality.

Sensors

The chip size is also important.
The image quality of any image from a 'full frame' DSLR will potentially be better than than one from an APS-C cameras, because the chip is over twice the size.
An image from an APS-C camera will potentially be better than than one from a compact camera because the chip could be 12 times the size.
In general the larger the chip the more pixels it can accommodate without the image becoming 'noisy'.
Generally more pixels mean bigger image, a lower pixel density will mean higher quality image. To have both you need a larger sensor.


File Formats
Files can be saved in a number of different formats. Some are best used for 'work in progress' whilst other are used for specific purposes, eg. sending to printers or for use on the web. Program specific formats - Photoshop psd or Gimp xcf files are good for files that may need to be worked on again, and tif and jpg files are more compatible with print systems.


Tiff .tif:
Advantages:
providing you don't use the compression mode no loss of quality, accepted by most D.T.P. programmes
Disadvantages:
uncompressed the files are large, does not support layers
New versions of Photoshop does - but don't do it!


Jpeg .jpg:
Advantages:
variable compression allows file sizes to be made much smaller for saving to disk and for sending over the inter-net or by e-mail (files can be one tenth of the size of a tif or psd). Standard image format for pictures on the web. Accepted by a large range of other programmes. Standard format for Photographic lab printing.
Disadvantages:
compression loses some quality especially if the file is opened and saved several times, does not support layers.

Compression with jpg files
See examples of images saved at different quality/compression settings.
Saving at high quality low compression will create a file without significant loss of quality, using the wrong settings will degrade the image.
The loss in quality is repeated each time a file is saved as a jpg.

 

Image saved as a high quality / low compression jpg file
  

Image saved as a low quality / high compression jpg file
Saving files as .tif will maintain the quality, but for photographic lab printing you will need to save as .jpg.