How can I change outfile path? outfile = join(basename(image))
<p>I can't figure out how to change the filepath on this code?</p>

<pre><code>import os
import glob
import time
import traceback
from time import sleep
import RPi.GPIO as GPIO
import picamera
import atexit
import sys
import socket
import pygame
from pygame.locals import QUIT, KEYDOWN, K_ESCAPE
import pytumblr
import config
from signal import alarm, signal, SIGALRM, SIGKILL
from os.path import join, basename, expanduser
from PIL import Image

def watermark(image):
        """ Apply a watermark to an image """
        mark = Image.open(watermark_img)
        im = Image.open(image)
        if im.mode != 'RGBA':
            im = im.convert('RGBA')
        layer = Image.new('RGBA', im.size, (0,0,0,0))
        position = (im.size[0] - mark.size[0], im.size[1] - mark.size[1])
        layer.paste(mark, position)
        outfile = join(basename(image))
        Image.composite(layer, im, layer).save(outfile)
        return outfile
</code></pre>

<p>I want it to go to either: <code>/home/pi/photobooth/pics/</code> or a <code>config.file_path</code> which is the same location.</p>

<p>Ok, so I have read the doc of PIL (all as expected) and You should try :</p>

<pre><code>outfile = join( &lt;your_path&gt; , basename(image) )  # replace your_path to actual path
Image.composite(layer, im, layer).save(outfile)
</code></pre>

python path filepath