Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8128493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:54:20+00:00 2026-06-06T07:54:20+00:00

I saw python codes to join two images in google app engine with ‘composite’.

  • 0

I saw python codes to join two images in google app engine with ‘composite’. But I need java codes to use ‘composite’ to merge two images. Showing an actual code would be very helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:54:24+00:00Added an answer on June 6, 2026 at 7:54 am

    This is my first reply, so hopefully I won’t be hammered too badly. Since nobody else answered this, and I spent a bit of time on this today, I thought I’d provide some code.

    The main reason this took way too much time for me, is that for whatever reason, the devserver simulation of the Images API doesn’t work right and the composite images are not correct when using the devserver. I was spending forever fiddling with the values in the devserver, until I just uploaded the test code to AppEngine, and it worked as expected. Argg!

    Anyway, the code below assumes you have two 300×300 images, one in aImage and other in bImage, that you want to paste side-by-side into a 600×300 new canvas, which is created in the resulting Image newImage:

    List<Composite> listComposites=new ArrayList<Composite>();
    
    Composite aPaste = ImagesServiceFactory.makeComposite(aImage, 0, 0, 1f, Composite.Anchor.TOP_LEFT);
    listComposites.add( aPaste );
    
    Composite bPaste = ImagesServiceFactory.makeComposite(bImage, 300, 0, 1f, Composite.Anchor.TOP_LEFT);
    listComposites.add( bPaste );
    
    Image newImage = imagesService.composite(listComposites, 600, 300, 0xff333333L, ImagesService.OutputEncoding.JPEG);
    

    The first makeComposite places the first image at location 0,0 relative to TOP_LEFT. The second makeComposite places the second image at 300,0. Both are pasted with opacity 1.0. Hope this helps. This code saves the result in JPEG format. And, again, for me, this DOES NOT WORK in the devserver, but works as expected on the real App Engine platform.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fastest way to uniqify a list in Python without preserving order? I saw many
I'm trying to setup a local database on my laptop using python. I saw
I saw the docs on the Instagram developers page. http://instagram.com/developer/endpoints/ But I want to
I saw that even by writing separate commands, we can combine two different types
I saw many threads with this tittle, but no one really speak about reuse
I saw some code when studying the open source project: here . But I
I need to plot a stem plot of my signal using python and matplotlib.
When I run this code on my computer with the help of Google App
Remember, this is using python. Well, I was fiddling around with an app I
I'm having a great time learning Python, but I've just gotten a bit stuck

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.