Step-by-step instructions for JPEG Repair Shop

Before you can start to repair your JPEG files you will need some basic knowledge about how the data is stored. Don't worry, I will try to keep this simple.

Data in JPEG files are stored in small rectangular blocks (called Minimum Coded Units, but in this text I will simple refer to them as 'blocks'). In the following image you can see an example of a block the have been selected in JPEG Repair Shop

Each of these blocks are stored together in the file. The different blocks are stored from left to right and from top to bottom like words in a text, so the first block in the file is the top-left block and the last block in a file is the bottom-right. This means that if you insert a block somewhere using JPEG Repair Studie then all the following blocks will be pushed to the right and the rightmost block on that line will be pushed to the line below. This effect can be seen in the two following images.

When JPEG files are corrupt then the blocks will not be decoded correctly, which can result in extra or fewer blocks in the image and the color offset might also be changed. Luckily JPEG Repair Shop have a tool to repair each of these errors respectivly: 'Remove MCU', 'Insert MCU' and 'Fix Colors'. However before you can start to repair the damages you have to find the exact blocks in the image were the corruption is.

Identifying corrupted blocks

In many cases it is quite easy to find the blocks were the corruption is. In the image below there are a very visible color difference after the place of corruption and the corrupted block clearly stands out from the rest of the blocks.

In other cases it can be difficult to find the exact blocks were the corruption occurs especially if the surrounding blocks look similar. Try to take one minute to look at the image below and see if you can spot the place of corruption before I explain how to find it.

The first thing you do is to look for a block that stands out, this is a bit hard to quantify without being to technical, but a corrupt block will almost always look "unnatural". But if the image is very large it might be too time consuming to scan all lines for "unnatural" blocks, so my next advice is to look for horizontal edges. If the blocks are very similar e.g. if it is an image of some grass or the sky, then the edges can be a bit hard to spot, but no matter how similar the blocks are there will almost always be a noticeable horizontal edge, and if you follow this edge you will find the corrupt blocks. Notice that the edge before the corrupt blocks will below the block and the edge after the corrupt block will be above it, you can use this information to find the corrupt blocks. I have illustrated this on the previous image below.

When the corrupted blocks are identified we are ready to repair the picture. We always fix blocks in the order they are stored in the file, so we go from left to right and work our way from the top to the bottom until all the corruptions have been fixed.

Remove and insert blocks

When you have found the first corrupt block you need to decide if you should remove a block or insert a block. If the image below the corruption is pushed to the right, then you need to remove a block, and if the image is pulled to the left, then you have to insert a block. When you have decided whether to insert or delete blocks, then you point the mouse to one of the corrupt blocks and click. This will select the block. Afterwards you click on either the 'Remove MCU' or the 'Insert MCU' button. Please note that 'Insert MCU' will insert a blank block - the original data have been corrupted and there is sadly no way to make get it back again.

Fix colors

You should always remove and insert blocks first, and then fix the colors afterwards. This is because the fix colors function works better when the blocks are aligned. To fix the colors you simply select the first block that is discolored and click the 'Fix colors' button. In case the color error is proceeded by one or more corrupt blocks then you can either select the first corrupt block or you can select the first non-corrupt discolored .block. The fix color button will work in both cases, but the corrupt blocks will be colored differently. Take a look at the images below to see the difference:

That's it! The last step is to click the 'Save image...' button and select where you want to store the repaired file. I hope this text helps with figuring out how to use the program. You can always play around and try things out without risking your images, nothing is saved to the disk before you press 'Save image...' and you are always asked where you want to save the fixed image.

Fixing the holes

JPEG Repair Shop can transform an image that is badly corrupted into an image, that looks almost like the original, but the fixed image can still contain "holes" from badly corrupt blocks or blank blocks that needed to be inserted. Fixing these holes is beyond the scope of JPEG Repair Studio, which only works with the data that is already present in the file, and you can either choose to accept the holes or you can try to fix them in a bitmap based image editing tool like Adobe Photoshop. This is however outside of my expertise, so you will have to look elsewhere for help with this.