Open the image in Photoshop.
Create a new layer above the image layer.
Go to Select – Color Range – A dialog box will open. Then select the brown color in the image.
A selection will appear.
Set the foreground color to white and then press Alt+Delete on the new layer created above the image layer. This will fill the selection with white color.
Deselect the selection.
Now create a new layer between the the original image and the image with white fill.
Select the brown color with eyedropper tool and fill the background with brown color.