Re: Text of an image

2008-09-05 Thread David Bovill
Interesting Klaus - I'd got into a bit of a habit of using Players often
instead of image controls - partly because you can display a wider range of
media - and well what's the difference?

In fact given you figures it would seem that there are the only reasons not
to use a player would be:

   1. Quicktime is not installed
   2. You don't want the media in external files

Or are there other reasons?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-05 Thread Klaus Major

Hi all,


Hi Ken and all,


The lockLoc of the second image must either be false OR the second
image must be the exact same size as the first image. Otherwise the
image/alphaData of the two images will not be the same.


Right. Here's a "cheat sheet" for those who care:  ;-)

the imageData of ...
...


thanks a lot for this one, Ken, very useful info!


Mabe the following is of some interest for Mac users* in this context.
...
...


OK, to be fair I should make test again with Rev 3.0 :-)
And sure will do on the weekend!


Best

Klaus Major
[EMAIL PROTECTED]
http://www.major-k.de


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-05 Thread Klaus Major

Hi Ken and all,


The lockLoc of the second image must either be false OR the second
image must be the exact same size as the first image. Otherwise the
image/alphaData of the two images will not be the same.


Right. Here's a "cheat sheet" for those who care:  ;-)

the imageData of ...
...


thanks a lot for this one, Ken, very useful info!


Mabe the following is of some interest for Mac users* in this context.

*This uses QuickTime player objects and one cannot say that
QuickTime is "optimized" for Windows or vice versa ;-)

I made some test about 2 years ago to see how fast one could resize
large images in Rev. I timed the same actions for referenced images
and for players.

The test were made with OSX on a G4 with 1 Ghz and 1 GB RAM!

1. I set the filename of a Rev image/player
2. computed the correct proporional thumbnail size from the "formatted  
dimensions"

3. locked the screen and
4. resized the image/player

Dimensions are in pixels, times in milliseconds.
Thumbnail sizes show the max height/width.

Image dimensions: 2560*1920
Thumbnailsize: 60*60
Rev img: 1786
Player: 78

Image dimensions: 2560*1920
Thumbnailsize: 100*100
Rev img: 1822
Player: 85

Image dimensions: 2560*1920
Thumbnailsize: 150*150
Rev img: 1896
Player: 75

Image dimensions: 2560*1920
Thumbnailsize: 200*200
Rev img: 1822
Player: 79

Image dimensions: 2560*1920
Thumbnailsize: 300*300
Rev img: 1924
Player: 76

!
Image dimensions: 3440*2580
Thumbnailsize: 150*150
Rev img: 2991
Player: 74

Very impressive I think, hope some find it useful.


Best

Klaus Major
[EMAIL PROTECTED]
http://www.major-k.de


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-05 Thread Ken Ray

> The lockLoc of the second image must either be false OR the second
> image must be the exact same size as the first image. Otherwise the
> image/alphaData of the two images will not be the same.

Right. Here's a "cheat sheet" for those who care:  ;-)

the imageData of 
-
Holds the Red, Green, Blue, and Alpha pixel values (bits) of the visual
representation of the image object. The amount of imageData in an image
object is (Height * Width * 4), regardless of whether there's an actual
image in the image object. (You can test this by creating an image object,
sizing it to any size you like, and then execute "put length(the imageData
of )" in the Message Box.)


the text of 

Holds the actual binary data for the image *inside* the image object. If
the image object's 'alphaData' property contains any other value than 255
(opaque), the data is stored in PNG format in the image.


Setting ImageData/Binary vs. Visual Copies
-
NOTE: When you set the imageData of an object, you are telling Rev to
*create the binary data* to represent the imageData you're passing it. This
has the result of causing the "text" of the image object to be different
than the "text" of a source image, even if they *look* the same. So for the
purposes of the list below, I use these terms:

   "binary copy" - The text of two images are the same, but the imageData of
the two images are different.

"visual copy" - The imageData of two images are the same, but the text
of the two images are different.

"exact copy" - Both the text and imageData of two images are the same.

"unique" - Both the text and imageData of two images are different.


Resizing/FormattedWidth/FormattedHeight
--
When you resize an image, the visual representation (imageData) changes, but
its binary representation does not. This is why an image object will
automatically resize itself to match the full dimensions of the image when a
card is opened UNLESS the image object's "lockLocation" (lockLoc) is TRUE.

Note that even though you can resize the rect of the image object, the
original image data's width and height are still accessible through the use
of the "formattedWIdth" and "formattedHeight" properties of the image
object.
 

Embedding vs. Referencing

When you embed an image (i.e. "Import as Control..."), the image object
created has both a visual representation (imageData) as well as a binary
representation (text).

When you reference an image (i.e. "New Referenced Control..."), the image
object created ONLY has a visual representation (imageData) and has no
binary representation at all (text is empty).


WORKING WITH TWO IMAGES
=

Source and Destination are Same Size

put img "Src" into img "Dest"

- Source is Embedded:
  img "Dest" has an EXACT COPY of img "Src"

- Source is Referenced:
  img "Dest" is empty (or emptied out)


set the imageData of img "Dest" to the imageData of img "Src"

- Source is Embedded OR Referenced:
  img "Dest" has an VISUAL COPY of img "Src"


Source and Destination are Different Sizes

put img "Src" into img "Dest"

- Source is Embedded, lockLoc of Dest is FALSE:
  img "Dest" is resized to match the width/height
  of img "Src", resulting in an EXACT COPY of img "Src"
 
- Source is Embedded, lockLoc of Dest is TRUE:
  img "Dest" is not resized, but holds a skewed view
  of img "Src", just as if you'd resized img "Src" to the
  same dimensions as img "Dest", resulting in a
  BINARY COPY of img "Src"

- Source is Referenced, lockLoc of Dest is TRUE or FALSE:
  img "Dest" is empty (or emptied out)
 
set the imageData of img "Dest" to the imageData of img "Src"

Source is Embedded or Referenced, lockLoc is TRUE or FALSE:
- img "Dest" contains visual garbage, and its
  size is unchanged, regardless of whether the lockLoc
  is TRUE or FALSE; img "Dest" is UNIQUE


TRICKS
==

Resetting an Image to its Original Size/State
--
If an embedded image has had its rect changed so that it is no longer the
original size, you reset the image like this:

  set the lockLoc of img 1 to false
  put img 1 into img 1

This is possible because the binary data (text) of img 1 has not changed
since it was imported; only the visual representation (imageData) has
changed. So putting the binary data of the image back into the image forces
Rev to resize the image (assuming the lockLoc is false).


Creating Thumbnails/Reducing Size of Stored Images

Re: Text of an image

2008-09-04 Thread Trevor DeVore

On Sep 4, 2008, at 2:26 PM, Scott Rossi wrote:


Perhaps one needs to get into the nitty gritty of *when* an object is
treated a PNG by Rev, but regardless:

1) if you import a GIF, you can assign both its image/alpha data to  
another

image by referencing its text

2) if you create a native image object within Rev, you can assign  
both its

image/alpha data to another image by referencing its text



...
But for
practical purposes, the text property does indeed reference both
image/alphadata.


This is true but there are some caveats.

The lockLoc of the second image must either be false OR the second  
image must be the exact same size as the first image. Otherwise the  
image/alphaData of the two images will not be the same.


Example: If the second image was twice the size of the first image  
(and had lockLoc set to true) and you assigned the text of the first  
image to the text of the second image then the imageData/alphaData  
would NOT be the same. This is because the imageData represents what  
is *visible* on the screen and the two images are not the same size.


What is most likely happening under the hood is that when you assign  
the text property of an image control Rev is creating the image/ 
alphaData based on the current size of the image control.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Scott Rossi
Recently, J. Landman Gay wrote:

>> In answer to your question about 'text' and 'alphadata', no, the 'text'
>> of an image does not contain the 'alphadata' image control property. It
>> can contain the alpha data as represented in the PNG format however.
> 
> Sounds like we need more clarification. ;)
> 
> I've been trying to track down a crash while working with images, which
> turns out not to be related to any of this. I thought I knew the
> difference between text and imagedata (and except for the above, I think
> I did.) Trevor's explanation may just be a different way of saying what
> Scott said though.

Perhaps one needs to get into the nitty gritty of *when* an object is
treated a PNG by Rev, but regardless:

1) if you import a GIF, you can assign both its image/alpha data to another
image by referencing its text

2) if you create a native image object within Rev, you can assign both its
image/alpha data to another image by referencing its text

I've heard that when working images in Rev, some things happen under the
hood at some point that cause Rev to treat images as PNG regardless of
whatever format they started as.  So Trevor's explanation may be
*technically* true, in that Rev treats ALL objects as PNGs.  But for
practical purposes, the text property does indeed reference both
image/alphadata.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Eric Chatonet

Bonsoir Richard,

I'm always worried when somebody, even you :-), says: sometimes it  
works and sometimes it does not ;-)

Does not sound good...
I have not experienced what you say:
As soon as imageData are related to current display (i.e. related to  
the size of the image object you put in), it always worked for me.

Can you be more specific?

Le 4 sept. 08 à 18:04, Richard Gaskin a écrit :


Eric Chatonet wrote:
Let's say you are creating thumbnails using large referenced  
images  (this means that your image object is locked with a lesser  
size).
set the text of img 1 to url("binfile:" & ) will   
display the image : OK.
And you'll be able to display it its original size in an unlocked   
image using the 'same text'.

If you add:
   set the imageData of img 1 to the imageData of img 1
This will fit the text of the image to its current locked size.
Many bytes saved :-)


I've been experimenting with a similar technique here to make  
thumbnails I can store in a stack, but have had mixed results:   
sometimes the imagedata in the new thumbnail image remains intact,  
other times it appears empty.


The source for these images are files on disk, displayed in an  
image object much smaller.  My goal is to get the imageData from  
the display image and create a new image in another stack with that  
thumbnail - any tips for doing that reliably?


--
 Richard Gaskin
 Managing Editor, revJournal


Best regards from Paris,
Eric Chatonet.

Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: [EMAIL PROTECTED]/



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Jim Ault
On 9/4/08 9:04 AM, "Richard Gaskin" <[EMAIL PROTECTED]> wrote:

>>set the imageData of img 1 to the imageData of img 1
>> This will fit the text of the image to its current locked size.
>> Many bytes saved :-)
> 
> I've been experimenting with a similar technique here to make thumbnails
> I can store in a stack, but have had mixed results:  sometimes the
> imagedata in the new thumbnail image remains intact, other times it
> appears empty.
> 
> The source for these images are files on disk, displayed in an image
> object much smaller.  My goal is to get the imageData from the display
> image and create a new image in another stack with that thumbnail - any
> tips for doing that reliably?

A different take on the issue.  At one point, windows in Rev that were on
monitors other than the main would display properly, but not be truly
accessible.  One function was the snapshot, as it could only be done on the
main monitor.

One solution I build would move the stack to the main monitor, take the
shot, then move it back.

Hope this helps

Jim Ault
Las Vegas


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Jim Ault
On 9/4/08 9:04 AM, "Richard Gaskin" <[EMAIL PROTECTED]> wrote:
>>set the imageData of img 1 to the imageData of img 1
>> This will fit the text of the image to its current locked size.
>> Many bytes saved :-)
> 
> I've been experimenting with a similar technique here to make thumbnails
> I can store in a stack, but have had mixed results:  sometimes the
> imagedata in the new thumbnail image remains intact, other times it
> appears empty.
> 
> The source for these images are files on disk, displayed in an image
> object much smaller.  My goal is to get the imageData from the display
> image and create a new image in another stack with that thumbnail - any
> tips for doing that reliably?

Perhaps you could add a test such as

set the clipboarddata to the imageData of img 1
if the length of the clipboarddata < 100 then
   -- the clipboardData is not likely enough bytes for an image
   --do something else that may solve the empty thumbnail occurrence
end if

Jim Ault
Las Vegas


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread J. Landman Gay

Scott Rossi wrote:


Yes -- the text refers to both properties.  Wish I had known this years ago.


Trevor DeVore wrote:

> In answer to your question about 'text' and 'alphadata', no, the 'text'
> of an image does not contain the 'alphadata' image control property. It
> can contain the alpha data as represented in the PNG format however.

Sounds like we need more clarification. ;)

I've been trying to track down a crash while working with images, which 
turns out not to be related to any of this. I thought I knew the 
difference between text and imagedata (and except for the above, I think 
I did.) Trevor's explanation may just be a different way of saying what 
Scott said though.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Richard Gaskin

Eric Chatonet wrote:
Let's say you are creating thumbnails using large referenced images  
(this means that your image object is locked with a lesser size).
set the text of img 1 to url("binfile:" & ) will  
display the image : OK.
And you'll be able to display it its original size in an unlocked  
image using the 'same text'.


If you add:
   set the imageData of img 1 to the imageData of img 1
This will fit the text of the image to its current locked size.
Many bytes saved :-)


I've been experimenting with a similar technique here to make thumbnails 
I can store in a stack, but have had mixed results:  sometimes the 
imagedata in the new thumbnail image remains intact, other times it 
appears empty.


The source for these images are files on disk, displayed in an image 
object much smaller.  My goal is to get the imageData from the display 
image and create a new image in another stack with that thumbnail - any 
tips for doing that reliably?


--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Eric Chatonet

Bonjour Jacque,

Just an add-up:

Let's say you are creating thumbnails using large referenced images  
(this means that your image object is locked with a lesser size).
   set the text of img 1 to url("binfile:" & ) will  
display the image : OK.
And you'll be able to display it its original size in an unlocked  
image using the 'same text'.


If you add:
  set the imageData of img 1 to the imageData of img 1
This will fit the text of the image to its current locked size.
Many bytes saved :-)

Le 4 sept. 08 à 16:18, Rob Cozens a écrit :


Hi Jacque,


What's the difference between the text of an image and its imageData?


The imageData is the image as it is currently displayed; the image  
text is the actual image as imported or referenced.  The imageData  
changes when the image is resized; the image text does not.


This means one loses image detail when referencing imageData of an  
image that is not displayed full-size.



Rob Cozens CCW
Serendipity Software Company


Best regards from Paris,
Eric Chatonet.

Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: [EMAIL PROTECTED]/



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Rob Cozens

Hi Jacque,


What's the difference between the text of an image and its imageData?


The imageData is the image as it is currently displayed; the image 
text is the actual image as imported or referenced.  The imageData 
changes when the image is resized; the image text does not.


This means one loses image detail when referencing imageData of an 
image that is not displayed full-size.



Rob Cozens CCW
Serendipity Software Company

"And I, which was two fooles, do so grow three;
 Who are a little wise, the best fooles bee."

 from "The Triple Foole" by John Donne (1572-1631) 


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-04 Thread Trevor DeVore

On Sep 4, 2008, at 1:11 AM, J. Landman Gay wrote:

What's the difference between the text of an image and its  
imageData? Does text include the alphadata?


If you 'put' the contents of an image file into an image control or  
set the imageData of an image control then the 'text' property  
contains the actual contents of the image file. An example:


put URL ("binfile:/Path/To/file.png") into img 1

For a PNG file or if you set the imageData that data would be in PNG  
format. This means you can recreate a PNG (or JPEG, etc.) file on disk:


put the text of img 1 into URL ("binfile:/Path/To/file2.png")

If you set the filename of an image, however, the 'text' of the image  
will return empty.


The imageData is a standardized means of representing the image in an  
image control. You know that it has 4 bytes per pixel and all pixels  
are represented. This makes it an easier format to create on the fly  
when creating image patterns, etc. For those not familiar with working  
with imageData take a look at the following lesson. It shows how to  
use imageData to create alternating line colors in a field:





In answer to your question about 'text' and 'alphadata', no, the  
'text' of an image does not contain the 'alphadata' image control  
property. It can contain the alpha data as represented in the PNG  
format however.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Text of an image

2008-09-03 Thread Scott Rossi
Recently, J. Landman Gay wrote:

> What's the difference between the text of an image and its imageData?
> Does text include the alphadata?

Yes -- the text refers to both properties.  Wish I had known this years ago.
:-)

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution