Object is not an image when Crop command

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Object is not an image when Crop command

JosepM
Hi List,

I try to crop a image with the rect of a graphic.

tObject is a graphic selected by the user.
img "picture" is a image loaded by the user from disk

The user move the graphic over the image and crop it, but only I get "Error: object is not an image"??
The graphic is irregular polygon, I mean that is not a rectangle or a box..

The code:

put the rect of the selectedobject into tObject
crop img "picture" to rect tObject

Any idea? :)

Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

Devin Asay

On May 10, 2010, at 10:22 AM, JosepM wrote:

>
> Hi List,
>
> I try to crop a image with the rect of a graphic.
>
> tObject is a graphic selected by the user.
> img "picture" is a image loaded by the user from disk
>
> The user move the graphic over the image and crop it, but only I get "Error:
> object is not an image"??
> The graphic is irregular polygon, I mean that is not a rectangle or a box..
>
> The code:
>
> put the rect of the selectedobject into tObject
> crop img "picture" to rect tObject
>
> Any idea? :)

Josep,

Are your images referenced to outside image data? The Rev Dictionary says this:  The crop command cannot be used on a referenced image. Doing so will cause an execution error.

Regards,
Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
Hi Devin,

Yes, I read the dictionary, but the image is loaded from disk not referenced. What is a image not referenced?
 

Salut,
Josep M

El 10/05/2010, a las 18:51, "Devin Asay [via Runtime Revolution]" <[hidden email]> escribió:


On May 10, 2010, at 10:22 AM, JosepM wrote:

>
> Hi List,
>
> I try to crop a image with the rect of a graphic.
>
> tObject is a graphic selected by the user.
> img "picture" is a image loaded by the user from disk
>
> The user move the graphic over the image and crop it, but only I get "Error:
> object is not an image"??
> The graphic is irregular polygon, I mean that is not a rectangle or a box..
>
> The code:
>
> put the rect of the selectedobject into tObject
> crop img "picture" to rect tObject
>
> Any idea? :)
Josep,

Are your images referenced to outside image data? The Rev Dictionary says this:  The crop command cannot be used on a referenced image. Doing so will cause an execution error.

Regards,
Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Object-is-not-an-image-when-Crop-command-tp2171784p2172400.html
To unsubscribe from Object is not an image when Crop command, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

Devin Asay

On May 10, 2010, at 10:57 AM, JosepM wrote:

>
> Hi Devin,
>
> Yes, I read the dictionary, but the image is loaded from disk not  
> referenced. What is a image not referenced?

The image would have to be imported, I believe, to be able to use the crop command with it.

Devin

>
> El 10/05/2010, a las 18:51, "Devin Asay [via Runtime Revolution]" <[hidden email]
>> escribió:
>
>>
>> On May 10, 2010, at 10:22 AM, JosepM wrote:
>>
>>>
>>> Hi List,
>>>
>>> I try to crop a image with the rect of a graphic.
>>>
>>> tObject is a graphic selected by the user.
>>> img "picture" is a image loaded by the user from disk
>>>
>>> The user move the graphic over the image and crop it, but only I  
>> get "Error:
>>> object is not an image"??
>>> The graphic is irregular polygon, I mean that is not a rectangle  
>> or a box..
>>>
>>> The code:
>>>
>>> put the rect of the selectedobject into tObject
>>> crop img "picture" to rect tObject
>>>
>>> Any idea? :)
>>
>> Josep,
>>
>> Are your images referenced to outside image data? The Rev Dictionary  
>> says this:  The crop command cannot be used on a referenced image.  
>> Doing so will cause an execution error.
>>
>> Regards,
>> Devin
>>
>> Devin Asay
>> Humanities Technology and Research Support Center
>> Brigham Young University
>>
>> _______________________________________________
>> use-revolution mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>> View message @ http://runtime-revolution.278305.n4.nabble.com/Object-is-not-an-image-when-Crop-command-tp2171784p2172400.html
>> To unsubscribe from Object is not an image when Crop command, click  
>> here.
>>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Object-is-not-an-image-when-Crop-command-tp2171784p2172408.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
OK. Now is imported into imagedata, but now say that is not a rectangle... :(  buf...

It's posible to export or copy a portion of the image but with a irregular shape?

Maybe I trying something not posible...

Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

Devin Asay

On May 10, 2010, at 11:36 AM, JosepM wrote:

>
> OK. Now is imported into imagedata, but now say that is not a rectangle... :(
> buf...
>
> It's posible to export or copy a portion of the image but with a irregular
> shape?
>
> Maybe I trying something not posible...

Crop only works with a rectangle. There may be others on the list who have figured out how to use an irregular shape as an image mask.

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

Michael Kann
If Scott Rossi doesn't know how, it can't be done.

--- On Mon, 5/10/10, Devin Asay <[hidden email]> wrote:

> From: Devin Asay <[hidden email]>
> Subject: Re: Object is not an image when Crop command
> To: "How to use Revolution" <[hidden email]>
> Date: Monday, May 10, 2010, 12:54 PM
>
> On May 10, 2010, at 11:36 AM, JosepM wrote:
>
> >
> > OK. Now is imported into imagedata, but now say that
> is not a rectangle... :(
> > buf...
> >
> > It's posible to export or copy a portion of the image
> but with a irregular
> > shape?
> >
> > Maybe I trying something not posible...
>
> Crop only works with a rectangle. There may be others on
> the list who have figured out how to use an irregular shape
> as an image mask.
>
> Devin
>
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


     
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

ScottR
In reply to this post by Devin Asay
Recently, Devin Asay wrote:

> Crop only works with a rectangle. There may be others on the list who have
> figured out how to use an irregular shape as an image mask.

You can't.  You can only group the graphic and image and use combined ink
effects.  Very limiting.  You can see the Spotlight demo on this page as an
example:
<http://www.tactilemedia.com/site_files/software/tutorials.html>

Alternatively, you can set the backPattern of the graphic to the ID of the
image, but there's no control over how the image is positioned relative to
the graphic.  I imagine one could use the "hidden point" technique of a
polygon (adding a space before an after a point in the polygon's point list)
to establish left and top offsets for the backPattern, effectively
offsetting the image within the graphic.  But this will only work with
polygon graphics.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
Hi,

Thanks for the replies..
I see the sample Spotlight, very cool.

I understand you but I don't know the "hidden point" technique :)
Where add a space in the polygon's list?


Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
Mmhh.. but with the backpattern in correct position how crop only these shape...

Sorry for my questions, never I must fighted with graphics issues in Rev until now... :)

The following is posible?
1 Export the snapshot ruled by the rect of a polygon over one part of the image.
2 Load the exported image and superpose the same graphic and make transparent the difference. I don't know if I explain myself.
3 Save as transparent the image
4 Load the transparent image over the original image.

It's for simulate painted walls, and I need extract the windows, picture frames and other nice stuff... :P

Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

ScottR
In reply to this post by JosepM
Recently, JosepM wrote:

> I understand you but I don't know the "hidden point" technique :)
> Where add a space in the polygon's list?

A polygon is derived from a list of points, one per line:

23,181
42,190
36,195
23,181

Adding an empty line between points in the list adds an invisible point to
the polygon that changes the polygon's dimensions without adding to the fill
or stroke of the polygon.

5,181

23,181
42,190
36,195
23,181

Using this technique, one could establish the *physical* topleft of a
polygon to occur at one location while the *visible* topleft of the polygon
occurs at a different location.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

sanke
In reply to this post by JosepM
JosepM jmyepes at mac.com wrote:


> OK. Now is imported into imagedata, but now say that is not a
> rectangle... :(
> buf...
>
> It's posible to export or copy a portion of the image but with a irregular
> shape?


and Scott Rossi scott at tactilemedia.com answered:


> Recently, Devin Asay wrote:
>
> > Crop only works with a rectangle. There may be others on the list
> who have
> > figured out how to use an irregular shape as an image mask.
>
> You can't.  You can only group the graphic and image and use combined ink
> effects.  Very limiting.  You can see the Spotlight demo on this page
> as an
> example:
> <http://www.tactilemedia.com/site_files/software/tutorials.html>



Hello Joseph,

It *is* possible to "export or copy a portion of the image but with a
irregular
shape".

Check out our stack "More about masks"

<http://www.sanke.org/Software/MoreAboutMasksRev3.zip>

Best regards,

Wilhelm Sanke
<http://www.sanke.org/MetaMedia>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

ScottR
In reply to this post by Devin Asay
Recently, Devin Asay wrote:

>> OK. Now is imported into imagedata, but now say that is not a rectangle... :(
>> buf...
>>
>> It's posible to export or copy a portion of the image but with a irregular
>> shape?
>>
>> Maybe I trying something not posible...
>
> Crop only works with a rectangle. There may be others on the list who have
> figured out how to use an irregular shape as an image mask.

It just occurred to me, if you don't mind using the group/ink option, you
can mask using the technique shown on the second card of this stack (execute
the following in your message box):
go url
"http://www.tactilemedia.com/site_files/downloads/masking_options.rev"

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
In reply to this post by sanke
Thanks Wilhelm for share :)
I modified the oval graphic to one polygon with irregular shape and work! :) I read the discussions and I understand more about the masking issues.
I don't see difference between some scripts respecting the edges problem. Also I haven't clear the comparation of rgb pixels...


Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
In reply to this post by ScottR
Hi Scott,

Thanks for the stack. Very cool the effect.
But I need to move the masked object, and your idea of use the BackgroundPattern inspired me and I found one solution that at first step solve my problem.

I have a image and some graphics "polygons" over.
The user select one of them and extract the image inside the edges of the graphic.
And then the user can move if they want or duplicate.

"the selectedobject" is the polygon

on mouseUp
   lock screen
   put the rect of the selectedobject into tRect
   import snapshot from rect tRect of image "picture"
   put the id of last image into tSnapshotId
   set the backgroundpattern of the selectedobject to tSnapshotId
   delete img id tSnapshotId

   set the layer of the selectedobject to top
   set the ink of the selectedobject to srcCopy
   unlock screen
end mouseUp


What you think about? Can I have any problem of memory if I use more graphics with backgroundpattern?

And other question to explore :)
How can empty the area of the image that is inside the graphic? Modifying the imagedata?
Or select a range of pixels and asign a new color?


Salut,
Josep
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

ScottR
Recently, JosepM wrote:

> I have a image and some graphics "polygons" over.
> The user select one of them and extract the image inside the edges of the
> graphic.
> And then the user can move if they want or duplicate.
>
> "the selectedobject" is the polygon
>
> on mouseUp
>    lock screen
>    put the rect of the selectedobject into tRect
>    import snapshot from rect tRect of image "picture"
>    put the id of last image into tSnapshotId
>    set the backgroundpattern of the selectedobject to tSnapshotId
>    delete img id tSnapshotId
>
>    set the layer of the selectedobject to top
>    set the ink of the selectedobject to srcCopy
>    unlock screen
> end mouseUp
>
>
> What you think about? Can I have any problem of memory if I use more
> graphics with backgroundpattern?

I don't think so.  If the graphics are large, and the user has to move them
around the card, there might be some slowness when dragging them around.


> And other question to explore :)
> How can empty the area of the image that is inside the graphic? Modifying
> the imagedata?
> Or select a range of pixels and asign a new color?

You can modify pixels of an image, but maybe it would be less complicated to
overlay a colored overlay object where you want it and create a new snapshot
to apply as the backgroundPattern.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Object is not an image when Crop command

JosepM
Hi,

<You can modify pixels of an image, but maybe it would be less complicated to
<overlay a colored overlay object where you want it and create a new snapshot
<to apply as the backgroundPattern.

This is what I doing but I can't erase the background or overlay with the new color.

The objective is to change the wall color with the shadows and some of the details.
Imagine a red wall, I create a poly with the shape of the wall, then I create a snapshot and put it as backgroundpattern into the poly. Then I can change the color of it to white but I loss the major of the shadows and details, only I can play with the blendlevel to show of the detail but this is borrowed.

Any idea how to deal with this?

Also I read the article of Kevin about the imagedata, maskdata and alphachanel. I don't know if is posible extract some chanel to use as shadow...

Salut,
Josep