Conjure composite problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
emptyofwhat

Conjure composite problem

Post by emptyofwhat »

Hello

it seems that no matter what I do I can not get composite to use anything other than the first image that is read in. even with the basic example, it always just uses the firs image and lays it out twice. Here is my msl code:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
  <group>
      <image id="family">
          <read filename="bust_19962_scaled.png"/>
          <resize geometry="300x300"/>
      </image>
      <image id="palm-trees">
          <read filename="bust_19965_scaled.png"/>
          <resize geometry="300x100"/>
      </image>
      <image>
          <read filename="bg.png"/>
          <composite image="family" geometry="+30+40"/>
          <composite image="palm-trees" geometry="+320+90"/>
      </image>
      <write filename="family-vacation.png"/>
  </group>

I only get the image id "family in the composite. Palm trees is missing

What I an doing wrong?

Thanks

Todd
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Conjure composite problem

Post by anthony »

does the image "bust_19965_scaled.png" exist?

this works fine for me with the images present...

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
  <group>
      <image id="im1">
          <read filename="im1.jpg"/>
      </image>
      <image id="im2">
          <read filename="im2.jpg"/>
      </image>
      <image size="500x500">
          <read filename="xc:none"/>
          <composite image="im1" geometry="+30+40"/>
          <composite image="im2" geometry="+320+90"/>
      </image>
      <write filename="show:"/>
  </group>
NOTE: outputing to "show:" displays the image on screen and allows the original program to exit once displayed. that way no file is saved to disk when debugging a script.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
emptyofwhat

Re: Conjure composite problem

Post by emptyofwhat »

thanks so much for responding!

The images do exist. The problem is just that the composite step only uses the first image loaded. Not the second image. If I switch the order of loading, it switches which one is used.

I will try again a little later

Thanks

eow
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Conjure composite problem

Post by anthony »

Actually I am suprizse my example actually even wrote anything!
The <write> is outside any <image> tag so it should not have any image specified for writing.

The other problem I can see in conjure is that I can't see how you can re-select a previous base image to work with!

This for example does not work.

Code: Select all

<group>
  <image id="canvas" size="500x500">
    <read filename="xc:none"/>
  </image>
  <image id="im1">
    <read filename="im1.jpg"/>
  </image>
  <image id="canvas">
    <composite image="im1" geometry="+30+40"/>
  </image>
  <image id="im2">
    <read filename="im2.jpg"/>
  </image>
  <image id="canvas">
    <composite image="im1" geometry="+30+40"/>
  </image>
  <image id="canvas">
    <write filename="show:"/>
  </image>
</group>
It seems to me that conjure has some very big limitations as to what it can and can not do. Specifically
  • limit/scope/delete/replace a specific image,
  • or re-select a already loaded image to do further work on a previously loaded image.
  • bad syntax error reporting making it difficult to even find the error it is complaining about
the main problem is the documentation contains no description of exactly what it is doing, and what these limits are.

Basically it is an API that never really took-off, is incomplete and unfinished.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply