JES is a programming environment that uses the Jython programming language. It provides a user-friendly interface for writing, executing, and debugging code.

You can use JES to edit a variety of media, including photos, videos, and sound. JES also offers many built-in libraries and functions. These can assist you with specific tasks, such as changing the color of pixels within an image.

Once you have finished editing an image, you can save it locally onto your computer.

How to Modify an Example Image

You can import and render an image in JES for editing.

  1. Open the JES application on your computer.
  2. In the programming window, create a new function called savePictureToFile():
            def savePictureToFile():
        
  3. Inside this function, display a file manager to prompt the user to select a file. Remember to indent your code as part of Jython's structure:
            file = pickAFile()
        
  4. Create a new picture object from the selected file:
            pic = makePicture(file)
        
  5. Make some changes to modify the image. For example, you can use JES to add text to the image. To do so, start by importing "java.awt.Font" to use styled fonts:
            import java.awt.Font as Font
        
  6. Create the text that you will display on the image, and give it some styling. Use the addTextWithStyle() function to add the text onto the image at a specific set of coordinates:
            str = "Text added to modify image"
    styledFont = makeStyle("Arial", Font.BOLD, 96)
    addTextWithStyle(pic, 200, 200, str, styledFont)

How to Save the New Image Onto Your Computer

You can use the built-in writePictureTo() function to save the new image as a new file on your computer.

  1. Still inside the savePictureToFile() function, and after editing the image, add a variable to store the file path. The details will depend on your operating system and file system structure. Here’s an example path to a Desktop folder on a Windows machine:
            pathToDesktop = "C:\\Users\\Sharl\\Desktop\\"
        
  2. Add a variable to store the name of the newly saved image:
            newFileName = "newPic.jpg"
        
  3. Use the built-in writePictureTo() function to save your new image as a file. Pass the picture you are saving into the function along with the full file path to save it to.
            fullPath = pathToDesktop + newFileName
    writePictureTo(pic, fullPath)
  4. To run the Jython script, click on the Load Program button, located between the programming area and the terminal.
    JES interface with code
  5. Type the name of the function into the terminal to run it:
            savePictureToFile()
        
  6. Use the file manager to select an image.
    JES file manager pop up
  7. Navigate to your desktop to view your new image file, with the modifications added to the photo.
    JES saved image of beach

Editing Images Using JES

JES makes it easy to make simple changes to images programmatically, then save the results. The environment provides many interesting techniques for image processing.