Author: David

  • What does JPEG actually do? (in camera)

    What does JPEG actually do? (in camera)

    I watched this video recently about a subject that frequently crops up in Photography on the nature of JPEG compression, and just how much compression should be applied, and what resolution you should use (in camera) if you’re a JPEG-shooter.

    Even though the video was a bit turgid in places, it got me to thinking about what a JPEG image looks like coming out of my camera against the RAW image I process. I watched it right to the end which showed some sticking power. I’ll give you what I interpreted as the main points of interest.

    Pixels are more important than the Quality slider when saving a JPEG for the best image. So save with loads of Pixels – original number if possible, don’t drop the resolution therefore – and use a lower quality setting to reduce image size if that’s an issue for the card in your camera. Then in post-production, as suggested in what I consider (imho) to be the best written expose of JPEG and Lightroom by Friedl, when you drop below 72-80% quality (compression) there’s not much decrease in image size, and very little drop-off in visual presentation.

    I’m fortunate to have two card slots in the Sony A7r MkIII and have set it up so that a JPEG image is sent to the second slot. This image is configurable by Quality (ie resolution – X-Fine, Fine, Standard) and Size (ie relating to the amount of compression applied – high 42m, medium 18m and small 11m). I thought it might be interesting to see what the images looked like when taken in a challenging lighting situation that required ISO 4000 to get a shot at 1/60@f4 on a 24mm lens. I thought I’d look at the RAW image as well to see how “superior” it was!!!

    Well that was interesting. Out of the camera all the JPEG images were sharper and that really puzzled me. Why? It took me a short while to realise that I’d forgotten the reason why I shot in RAW in the first place. Duh! RAW just captures what the camera sees. It doesn’t apply any corrections. It just sees the image and records it. Phew! I realised I had to look at Noise Reduction and Sharpening to get the RAW image close to what the JPEG was giving me, but I have to admit the JPEG taken at Xtra-Fine and High gave a very good image straight out of the camera (that’s the one on the right above), and if I didn’t want to do any post-processing, I’d have been happy with it.

    [Note the shot on the left is the unprocessed RAW image saved with no compression; the one in the centre is the processed RAW image at 80% quality (compression)]

    Some statistics for the JPEG shots:

    Size of image from camera Original Resolution Cropped Resolution Saved at 80% compression Saved at 100% (no) compression
    XF-H 23.4MB 7952×5304 2137×2137 946KB 2.8MB
    XF-S 7.3MB 3984×2656 1070×1070 365KB 886KB
    Std-H 7.6MB 7952×7952 2102×2102 901KB 2.4MB
    Std-S 2.7MB 3984×2656 1088×1088 384KB 824KB

    Key:
    XF = Xtra-Fine (high resolution)
    Std = “standard” resolution
    H = High File Size (ie little compression to reduce file size)
    S = Small (ie considerable compression to reduce file size)

    I cropped all the images including the RAW image (originally 85.8Mb in size) to a square to get a comparable image at each resolution. For the RAW image this was 2126×2126 – comparable with the XF-L and Std-L JPEG images. I then saved the images at 80% Quality and 100% Quality (ie no compression) in Lightroom. For the RAW file this gave figures of 4.9Mb for the 100% Quality, and 1.5Mb for the 80% Quality. So you end up getting a JPEG from a RAW file (at this resolution) that is not greatly different from the JPEG taken from the camera.

    How did I get the RAW to outperform the JPEG? I had to look at a number of sliders in Lightroom. Starting with Noise Reduction and then moving on to using Texture to arrive at an image that I liked. So the question is … is it worth using JPEG to just capture the moment. The answer is most definitely YES. I’ve always said that, and this piece of empirical research suggests that JPEG in the Sony camera is very good at noise reduction and sharpening. You may lose the colour information and the tones are not represented quite as well; but in this poor lighting situation where the ISO is very high (ISO 4000) the quality of the JPEG image is very good. So, armed with this information I just need to make a decision on how I set the camera up. Do I want to save a JPEG image as a backup to the RAW, in which case I need to set it to XF-H (in my notation), or for taking the card out of the camera to share on social media, in which case I would probably set the camera to record the JPEG shot as a Std-S image.

    These are some of the test shots taken whilst I had my feet up! You can download the originals from the [Download] link under the photo if you want to more closely examine them.

    The uncropped Std-S JPEG image saved at 100% [Download]

    The cropped JPEG image saved from Lr at 100% reducing the file size to 2.8Mb; a loss of detail, but generally excellent noise reduction. [Download]

    The cropped RAW image, grain and noise present because of high ISO [Download]

    The finished RAW image at 80% Quality, after Noise Reduction – luminance and sharpening applied, as well as a bit of Texture added. Image size now 1.7Mb reduced from 6.4Mb cropped image. [Download]

    So a final conclusion … if you’re a JPEG-man, I guess you should do the minimum amount of compression in camera, and you should shoot at the highest possible resolution. Then in post-processing you can safely save your JPEG at a reasonably high-rate of compression (lower quality setting) whilst keeping the resolution as high as you can. Does that rather obvious statement make sense?

  • My first encounter with computers

    For me it would be being introduced to an ICL 4130 (formerly an Elliot Computing 4130) mainframe and the use of punch card decks. I was instructed on how to program the computer using the computer language Algol-60 and I had to write the code on sheets that were then punched by punch card operators. Somewhere, I have a booklet which describes the machine … somewhere!

    Anyway, by the time I’d got started on my computing life the 4130 was getting a bit long in the tooth and the form for Universities in those days (remember everything was centrally funded by the Universities Grant and Research Grant Committees of the Education Department then) was to get a visit from the Computer Board – a group of the wise and worldly (it must have been, I went on to serve on its successor body much later on – the Joint Information Systems Committee) who would adjudicate whether an institution needed a new computer or, if it was between its regular visits, whether the Computer Centre needed new peripherals such as disk drives, printers or plotters. As a research student (at UCW Aberystwyth) I, along with my other researchers were fully prepped to be able to say the right thing just in case one of these visiting folk asked a question. What fun! The preparation must have paid off because we got a new machine.

    The ICL 4130 was replaced by an ICL 1900 series machine running George 3 – a proper operating system [I think a second machine was purchased later on and they were linked so that one could handle batch punch card jobs and the other handled teletype terminals and possibly output]. Of course this was the time when Computer Operators were needed and they ran jobs (including back-ups) overnight and had to be in attendance to change magnetic tapes, and handle printed output – a lot of which was created by me!

    I was teaching myself multi-variate statistics, mainly based on linear and multiple regression models, but also principal components and factor analysis and using standard programs which I modified in part to my research subject because I needed mapped output, on a line-printer! The main program I worked with however was written (in Fortran IV) by David Wishart from St Andrews for Cluster Analysis, so I learnt to program in Fortran and this soon replaced Algol-60 as my preferred programming language. This program and its adaptation to spatial analysis (in which I followed the work of a fellow researcher called Stan Openshaw who was using the technique in human geography to group together similar grid cells from maps) was to take up a huge part of the next 10 years of my life as I worked hard to avoid actually going out to do any field work on my research topic “Contemporary Erosion in mid-Wales”. Most of my jobs were by now being run by remote job entry at the Manchester Regional Computing Centre as the size of my data set was too large to run in the UCW Aberystwyth Computer Centre.

    It was an exciting time to be a geographer and books and monographs were being published on quantitative geography amongst which were ones in the Institute of British Geographers CATMOG series, still in my possession, by a certain John Silk. A lovely coincidence that brings John and myself together and allows us to reminisce on the early 1970’s and “the quantitative revolution” as it was called by some!

    Through the 1970’s I returned every summer holiday to Aber, and camped at the top of Penglais Hill to get time on the mainframe. In between these visits I would sit at a teletype at Doncaster College of Education, where I was now a Lecturer in Physical Geography, and submit jobs to the IBM 360 mainframe at what was then Sheffield Polytechnic. It had to be said that by 1978-9 my main interest (apart from the family that was now arriving on the scene) was in computing, not geography, and so when a friend asked me to put my knowledge to work in programming some engineering design problems, I accepted the challenge, set up my own consultancy (with my HoD’s approval) and started programming an Olivetti P6060 desktop computer using Basic. Having it at home to do the work allowed my eldest daughter (44 yesterday) to have a go at programming …

    So now the link to geography had begun to be broken. This was severed by Shirley Williams decision in 1978 to close the Teacher Training part of the College where I worked. I bravely, one of my colleagues thought foolishly given that we had by now three young children, decided to opt for voluntary redundancy on the basis of being given a year’s fully-paid retraining. I went to Bradford University and did a one-year MSc in Computer Science giving me letters after my name to go with my 10+ years programming experience. Here I was introduced to the DEC PDP-11/60 mini-computer – a lovely machine running Unix, which was a lovely operating system which I continue to use in it’s Linux incarnation, to this day. I wrote my thesis on building a disk operating system (Modus) for a PDP-8 using a high-level structured programming language (Wirth’s Modula) on the PDP-11. I could now program in Algol-60, Basic, Fortran iV, Fortran 66, Cobol, PDP Assembler, Pascal and Modula.

    It was the latter language (the first concurrent programming language and the precursor of first Modula-2 and then Ada) that enabled me to get a job as a Systems Programmer / Computer Lecturer at South Glamorgan Institute of HE at Llandaff. I was returning to Cardiff and HE. Not a very bold move and “only for 4 years max” (which is what I said to Jenny). That was not to be! At SGIHE/CIHE/UWIC I oversaw the introduction of a mini-computer service based initially on a Prime 550, then Prime 750 and so on, initially writing the systems programs for its operating system – Primos in Fortran, PL/P and SP/L, and then becoming Head of the Computer Centre where I dabbled in producing the first website for the institute, which has since been a continuing interest for me.

    Here are a few pictures of the Computer Centre at UWIC taken before I left for UWCM at UHW (The Heath) …

    The Operator’s Consoles for each system are on the left, the tape rack for the day’s tape back-ups are in the background, a terminal room with micro-computers was alongside the Computer Centre …

    The original Line printer (orange) was till in service, the Prime 750 is in the background …

    I’d become a manager, and the rest is another story, which I’ll record another day!

    At home we’d purchased one of the first BBC-B Computers – the first of a long series of domestic computers which again is another story, which I’ll record another day!

    David Harrison, June 2020