# PseudoHDR from single JPEGs



## MartinSykes (Mar 1, 2010)

Hi all,

Quick introduction - recently got interested in HDR but don't have the camera equipment to do it properly yet (just a compact digital that only saves jpegs). I also had a lot of old jpegs which I wanted to improve but couldn't find anything to do what I wanted (for free anyway) so I wrote my own program. Would be interested in feedback and it's free if anyone else finds it useful - you can download it from http://www.martinandanna.talktalk.net/autohdr.html 

It only works on single jpegs but produces 'natural' looking HDR-style effects. It's not fast (about 30s per megapixel) and uses a lot of memory so you might want to resize images down below 10MP if they're bigger than that but I think the results are pretty nice and worth the wait. You can do the more garish stuff afterwards in your favourite photo/paint package. Quick example:


----------



## Provo (Mar 2, 2010)

I am not knocking down your attempt here, but HDR is comprised of bracketed images at different exposure settings this can be done with 3 different options 3 raw exposure images in increments of either +2,0,-2 (or 6 multi exposed raw bracketed images of +/-1 EV steps) another method is to have multi bracketed exposed images in jpg format ( Ex: +/-1 EV or +/-2EV steps) and finally the last one can be achieved from a single RAW image  that you manually set the Ev(Exposure) setting using a RAW image processor such as camera raw in Photoshop. (Although if on youtube you will find some people using a single jpg and claiming as a HDR which goes against most HDR guides & by definition is not a true HDR)
There is no way you can take a single jpg image and claim it as an HDR image all you will be doing is color enhancing the image aka tone mapping the details which is not a true HDR some image sources might give you a close to HDR image but it&#8217;s not the same. Given the example you have used all I notice is the image has been color enhanced that&#8217;s about it, and you can see in the shades in the water some over burn color areas as a result of the technique being used. The color on the child is noticeably better enhanced thats about it.

Wiki: HDR
HDR Guide
HDR Guide 2


----------



## MartinSykes (Mar 2, 2010)

I'm not claiming this is HDR - that's why I titled the thread PseudoHDR - It's a poor relation to the full technique but nevertheless a useful approach which can give nice results where all you have is a single jpeg to work from. I unfortunately only have a compact digital at the moment which doesn't even support RAW.

I think the multiple exposures is a bit of a red-herring. They are only needed because current camera technology can't capture the full range in one go. As soon as someone builds a better camera then you could capture as much range as you need in a single exposure and all of the problems with aligning multiple exposures would disappear. A better definition of HDR should be based on the absolute range the scene contains, regardless of how many exposures it took to capture that and the method of transformation from that to the more limited available display range.

Incidentally, my program only adjusts the brightness channel and leaves the hue/saturation untouched. Here's another example where I pushed it a bit harder:


----------



## Overread (Mar 2, 2010)

Ahh but if the camera could capture the whole light range in a single exposure you wouldn't have HDR processing anymore  At least when you can capture the whole range of lightings with the settings needed at the time. Also remember that when a camera records perfect under or overexposure all it records is black or white data and no details. This is a problem with single shot HDR in that you can thus only push those areas so far before they are lost completly - RAW gives a bit more flexability of course - but totally lost details won't come back. So you do need a fairly flat lighting range to get false HDR from a single exposure to work properly. 


Interestingly I don't like what the program has done to your second shot - it made the depth of field look a lot deeper by messing around but the shot jus has something off about it. I guess its me comparing the nice green mossy moss on the left with the more harsh display of moss on the right. Also using programs can bring out the halo effect - and if you look on the underside of the tree you can see a clear kind of bright zone hugging the tree. 

The shot itself is not too bad lighting wise and to be honest if you have something even as cheap as photoshop elements playing around with adjusting the shadow and highlight brightness as well as the contrast tool and levels you can probably get a goood result without the HDR program.

That said I have used this program and method here:
http://www.motleypixel.com/forum/index.php/topic,79.msg143.html#msg143
to good effect in the past - but you need a very good shot for it to work well to start with.


----------



## MartinSykes (Mar 2, 2010)

I think it would be safer to say that when the display medium could display the entire range we wouldn't need HDR processing. Whether you capture 32+ bits of information per pixel from a single shot or many, your display can't display that much so you need some clever processing - HDR or something else to make sure you don't just lose the extra. But yes, I agree that a single jpeg doesn't contain the lsame evel of information that a single RAW, or multiple exposures gives. But that doesn't mean you can still make more of what little it does have.

I'd also agree the second shot doesn't look 'nice' - I did push it too far just to see if I could. The halo isn't created by the HDR here though - it's there in the original but the processing makes it more noticeable. The approach I came up with uses clever edge-detection to work out what needs lightening/darkening rather than the less sophisticated 'area within a radius' method that can cause halos in some other solutions.


----------



## williambarry (Mar 2, 2010)

I am curious as to why someone attempting hdr would work with jpegs anyway? Jpegs are horrible.


----------



## MartinSykes (Mar 2, 2010)

> I am curious as to why someone attempting hdr would work with jpegs anyway? Jpegs are horrible.


 
Simply necessity for the amateur who can only produce single-shot jpegs or happens to have an old jpeg they want to revive. I think anyone would rather use RAW and/or multiple exposures to get better quality results given the choice but it's a luxury a lot of people don't have.

[EDIT} incidentally, I quite like the definition at the top of the page. It doesn't impose any requirements on the use of multiple exposures or even the depth of a single image, just that the end result addresses the problem of light/dark areas in an original image: 


> High Dynamic Range Imaging (HDRI or just HDR) is a set of techniques that allows a greater dynamic range of luminances between light and dark areas of a scene.


----------



## Provo (Mar 4, 2010)

A good source of why multiple shots are prefered over a single raw image for HDR
can all be explained here. But short summary contrast ratio and the dynamic range of the file format in place has it limitations. The Dynamic Range for jpg is 256:1 at 8Ev opposed let's say a 16bit tiff file which is dynamic range is 65,536:1 at 16Ev

This is why we shoot AEB Auto Bracketing Ex: +2,0,-2 etc.. 3 exposed images
or use the single image RAW and change the exposure being that the RAW image has a great amount of Dynamic Range then the single Jpg.

Understanding Dynamic Range in Digital Photography

Vanilla Days : HDR Tutorial Guide Thing for Photomatix


----------



## TiaS (Mar 4, 2010)

I think you are being given abit of a hard time on here. You are not the first person to have this idea. Dynamic Pro HDR does both this witoh one image and HRD with multiple exposed images. I think it is a good idea to have such a program if you think you will use it


----------



## MartinSykes (Mar 4, 2010)

Thanks. I have a thick hide so I can take the flak. I'll definitely use it personally - as I said, I only have single jpegs so it's really the only approach open to me at the moment. I figured others in the same situation might find it just as useful. Next step will be to extend it to RAW and multiple images but I wanted to get the basic algorithm right first. It's a bit different to how I understand some of the other programs work so might be worth taking further. I should be able to process a RAW in one go instead of mucking about splitting it into three 'exposures'. I'm pleased with the results anyway even if this is as far as it goes - here's another one which turned out pretty well I think:


----------



## MrRamonG (Mar 4, 2010)

Provo said:


> A good source of why multiple shots are prefered over a single raw image for HDR
> can all be explained here. But short summary contrast ratio and the dynamic range of the file format in place has it limitations. The Dynamic Range for jpg is 256:1 at 8Ev opposed let's say a 16bit tiff file which is dynamic range is 65,536:1 at 16Ev
> 
> This is why we shoot AEB Auto Bracketing Ex: +2,0,-2 etc.. 3 exposed images
> or use the single image RAW and change the exposure being that the RAW image has a great amount of Dynamic Range then the single Jpg.



Stop beating a dead horse.  I don't think the guy is contesting your point that 3 or more bracketed RAW images are ideal for HDR.  He is simply trying to work with what he has, one jpg.


----------



## MrRamonG (Mar 4, 2010)

Seeing what you had to start with, 1 jpg, and that you wrote the program yourself, i think the results are good looking.  Looks like your limitations also prevent you form getting that over-HDR-processed look.


----------



## Tulsa (Mar 4, 2010)

MartinSykes said:


>


 
Did you do something to this one? looks like an average non PP shot.


----------



## Mulewings~ (Mar 4, 2010)

Just a curious note...HDR then truly can only be a stationary object correct?

That is...multiple exposures of a running deer would not work!

A building, flower, plant would...


----------



## fokker (Mar 4, 2010)

MrRamonG said:


> Seeing what you had to start with, 1 jpg, and that you wrote the program yourself, i think the results are good looking. Looks like your limitations also prevent you form getting that over-HDR-processed look.


 
Agreed, I say good job on seeing a problem and coming up with a solution that actually works.


----------



## weatherduder (Mar 4, 2010)

This is a pretty nice software you made. yeah its not HDR but it sure enhances pictures greatly. 

I'm just curious. How did you go ahead and make this software? what did you have to do to make it.


----------



## MartinSykes (Mar 5, 2010)

@Mulewings - in theory you can do HDR on moving objects but using multiple exposures you get shosting even on small movement like leaves on trees. It's impractical rather than impossible at the moment I think.

@weatherduder, I just downloaded the free version of Visual Basic. Code is relatively simple - load a picture, do some maths on the pixel values and save it again. Didn't cost anything other than some spare time.

@tulsa, This was the original of the Tower of London for reference. The main 'HDR' effect has been to improve the range on the tree and shadows but also at a smaller scale, the range used on the bricks etc. makes the detail stand out more. If nothing else, your comment  at least shows I'm on the right track towards a 'natural' looking HDR effect. Although it's not really HDR but shows you can still use the process on an image which is otherwise properly exposed. I'm a bit confused as to why some proper HDR shots use 3 exposures if their middle exposure doesn't contain any clipped shadows or highlights. Surely the extra exposures don't provide any more information other than maybe helping to average out noise.


----------



## Tulsa (Mar 5, 2010)

Maybe it's just me but I think the same effect shown with a single image can be had with a little PP.


----------



## NateS (Mar 5, 2010)

Tulsa said:


> Maybe it's just me but I think the same effect shown with a single image can be had with a little PP.



Easily and much quicker.  I can add a little tonal contrast and get a nearly identical effect....and I can adjust a lot of aspects of the tonal contrast to get a more specific look as well and it takes about 1/10th of a second per megapixel.

Not trying to tear anybody down, but I don't see the point of trying to make something look like an HDR.  I'm the exact opposite.....when I actually do create a HDR from three images, I work fairly hard to make sure that it looks as natural and un-HDRish looking as possible.

That said, you'll find a lot of people who just want that look on everything no matter what and it might be appealing to them (as long as they don't figure out that there's faster ways to do it).


----------



## Tulsa (Mar 5, 2010)

MartinSykes said:


>



I spent 7 minutes in PP and came up with this... 




Maybe I just dont understand what you are going for??


----------



## Provo (Mar 6, 2010)

Mulewings~ said:


> Just a curious note...HDR then truly can only be a stationary object correct?
> 
> *That is...multiple exposures of a running deer would not work!*
> 
> A building, flower, plant would...


 
Mulewings

You can capture moving objects and make and HDR in one of two ways single shot converstion to HDR using the single raw approach.

or if your camera allows you to shoot AEB continous almost like sports mode. Continous would not really work for let's say race cars,or soccer match.


----------



## weatherduder (Mar 12, 2010)

MasterPhotoWorkshops said:


> I've read through this post and just wanted to plug my instructional DVD program. It's for the advanced amateur photographer that is just getting into HDR. Renowned outdoor & nature photographer Tony Sweet shows how he captures the series of images and the processing techniques he uses for creating realism, hyper-realism, and the "grunge" look. I have free samples and a gallery of his images.
> 
> Check it out at
> 
> ...



mind giving us a free look at them? :mrgreen:


----------

