Re: deleting every other line in an image

2007-11-14 Thread BNig

Hi Josh,

this script works with your picture but gives you an image half the width
and heigth of the original

on mouseUp
put the width of image "P1" into theImagWidth
put the height of image "P1" into theImageHeight
put the imagedata of image "P1" into theDataToWorkon
if theDataToWorkon = "" then exit mouseUp
put length (theDataToWorkon) into HowLong
put empty into destImageData

-- one Pixel = 4 Bytes = 4 chars
put theImagWidth * 4 into OneRowOfImage

put 0 into theCounter
repeat   with i = 1 to (HowLong - OneRowOfImage) step (OneRowOfImage*2)
put  char i to (i + OneRowOfImage-1) of theDataToWorkon  after
destImageData
end repeat

set the width of image "P2" to theImagWidth
-- watch out for images with uneven heigths
set the height of image "P2" to (theImageHeight/2)
set the imagedata of image "P2" to destImageData

-- now set the width to half
set the width of image "P2" to (theImagWidth/2)
end mouseUp


I had it adapted to double the lines but that is what masmit did in his
script, that keeps the original size of the image. Scaling it down gives a
crisper image as far as I see.

all the best

bernd






Josh Mellicker wrote:
> 
> Hello Bernd,
> 
> I tried and tried but could not get the script to work.
> 
> It produces an image with half the content widthwise, and I am still  
> trying to get it to copy every other complete line...
> 
> Here is a typical source image:
> 
> http://revcoders.org/resources/temp.png
> 
> You can see the obvious interlacing, as the dolphin was saying "yes"  
> to the question "would you like a fish?"
> 
> I am attempting to copy every other line to a new image, then set the  
> width to half as well so the picture maintains its aspect ratio.
> 
> Does your script work with that image?
> 
> Thanks!
> 
> 
> On Nov 12, 2007, at 3:34 PM, BNig wrote:
> 
>>
>> Hi Josh,
>>
>> make a stack with 2 images, call them "P1" and "P2"
>> load a picture in the inspector into image "p1"
>> set the width and height to 140 in the inspector
>>
>> make a new button
>>
>> paste this script into the button
>>
>> on mouseUp
>> put the width of image "P1" into theImagWidth
>> put the height of image "P1" into theImageHeight
>> put the imagedata of image "P1" into theDataToWorkon
>> if theDataToWorkon = "" then exit mouseUp
>> put length (theDataToWorkon) into HowLong
>> put empty into destImageData
>>
>> -- one Pixel = 4 Bytes = 4 chars
>> put theImagWidth * 4 into OneRowOfImage
>> put theImageHeight into soManyPixelRows
>>
>> put 0 into theCounter
>> repeat   with i = 1 to (HowLong - OneRowOfImage) step  
>> (OneRowOfImage*2)
>> put  char i to (i + OneRowOfImage-1) of theDataToWorkon  after
>> destImageData
>> end repeat
>>
>> set the width of image "P2" to theImagWidth
>> -- watch out for images with uneven heigths
>> set the height of image "P2" to (theImageHeight/2)
>> set the imagedata of image "P2" to destImageData
>> end mouseUp
>>
>> this should give you in "P2" an image half the height of P1 with every
>> second line of the original image.
>>
>> it works for me, attention, almost no error checking in here,
>> it is important to have the width and height correct otherwise the  
>> image
>> will be distorted
>>
>> just curious: why do you want to eliminate every second line of an  
>> image?
>>
>> hth
>>
>> Bernd
>>
>>
>>
>> Josh Mellicker wrote:
>>>
>>> Here's one for the image processing gurus out there:
>>>
>>> How difficult is it to take an image, and create a new image
>>> containing every OTHER line from it (e.g., just the odd lines) so the
>>> resulting picture is half the height?
>>>
>>> Once you knew the width of the image, isn't it just a loop that
>>> copies tWidth pixels, then skips the next tWidth, and so on?
>>>
>>> Thanks!
>>> ___
>>> 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
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/deleting-every- 
>> other-line-in-an-image-tf4793676.html#a13716667
>> Sent from the Revolution - User mailing list archive at Nabble.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
> 
> ___
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/deleting-ev

Re: deleting every other line in an image

2007-11-13 Thread Josh Mellicker

Hi Mark,

Your script works perfectly! You are a genius!!!

Thanks!


On Nov 13, 2007, at 7:21 PM, Mark Smith wrote:


Josh, does this do what you want?

on stripAltLines pImg
   put the imagedata of img pImg into tData
   put the width of img pImg * 4 into bytesPerLine
   put the height of img pImg into numLines

   repeat with n = 2 to numLines step 2
  put char (((n -1) * bytesPerLine) + 1) to (n * bytesPerLine)  
of tData into tLine

  put tLine & tLine after newData
   end repeat

   set the imagedata of img pImg to newData
end stripAltLines

Best,

Mark

On 13 Nov 2007, at 18:31, Josh Mellicker wrote:


Hello Bernd,

I tried and tried but could not get the script to work.

It produces an image with half the content widthwise, and I am  
still trying to get it to copy every other complete line...


Here is a typical source image:

http://revcoders.org/resources/temp.png

You can see the obvious interlacing, as the dolphin was saying  
"yes" to the question "would you like a fish?"


I am attempting to copy every other line to a new image, then set  
the width to half as well so the picture maintains its aspect ratio.


Does your script work with that image?

Thanks!


On Nov 12, 2007, at 3:34 PM, BNig wrote:



Hi Josh,

make a stack with 2 images, call them "P1" and "P2"
load a picture in the inspector into image "p1"
set the width and height to 140 in the inspector

make a new button

paste this script into the button

on mouseUp
put the width of image "P1" into theImagWidth
put the height of image "P1" into theImageHeight
put the imagedata of image "P1" into theDataToWorkon
if theDataToWorkon = "" then exit mouseUp
put length (theDataToWorkon) into HowLong
put empty into destImageData

-- one Pixel = 4 Bytes = 4 chars
put theImagWidth * 4 into OneRowOfImage
put theImageHeight into soManyPixelRows

put 0 into theCounter
repeat   with i = 1 to (HowLong - OneRowOfImage) step  
(OneRowOfImage*2)
put  char i to (i + OneRowOfImage-1) of theDataToWorkon   
after

destImageData
end repeat

set the width of image "P2" to theImagWidth
-- watch out for images with uneven heigths
set the height of image "P2" to (theImageHeight/2)
set the imagedata of image "P2" to destImageData
end mouseUp

this should give you in "P2" an image half the height of P1 with  
every

second line of the original image.

it works for me, attention, almost no error checking in here,
it is important to have the width and height correct otherwise  
the image

will be distorted

just curious: why do you want to eliminate every second line of  
an image?


hth

Bernd



Josh Mellicker wrote:


Here's one for the image processing gurus out there:

How difficult is it to take an image, and create a new image
containing every OTHER line from it (e.g., just the odd lines)  
so the

resulting picture is half the height?

Once you knew the width of the image, isn't it just a loop that
copies tWidth pixels, then skips the next tWidth, and so on?

Thanks!
___
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




--
View this message in context: http://www.nabble.com/deleting- 
every-other-line-in-an-image-tf4793676.html#a13716667

Sent from the Revolution - User mailing list archive at Nabble.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


___
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


___
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


___
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: deleting every other line in an image

2007-11-13 Thread Mark Smith

Josh, does this do what you want?

on stripAltLines pImg
   put the imagedata of img pImg into tData
   put the width of img pImg * 4 into bytesPerLine
   put the height of img pImg into numLines

   repeat with n = 2 to numLines step 2
  put char (((n -1) * bytesPerLine) + 1) to (n * bytesPerLine)  
of tData into tLine

  put tLine & tLine after newData
   end repeat

   set the imagedata of img pImg to newData
end stripAltLines

Best,

Mark

On 13 Nov 2007, at 18:31, Josh Mellicker wrote:


Hello Bernd,

I tried and tried but could not get the script to work.

It produces an image with half the content widthwise, and I am  
still trying to get it to copy every other complete line...


Here is a typical source image:

http://revcoders.org/resources/temp.png

You can see the obvious interlacing, as the dolphin was saying  
"yes" to the question "would you like a fish?"


I am attempting to copy every other line to a new image, then set  
the width to half as well so the picture maintains its aspect ratio.


Does your script work with that image?

Thanks!


On Nov 12, 2007, at 3:34 PM, BNig wrote:



Hi Josh,

make a stack with 2 images, call them "P1" and "P2"
load a picture in the inspector into image "p1"
set the width and height to 140 in the inspector

make a new button

paste this script into the button

on mouseUp
put the width of image "P1" into theImagWidth
put the height of image "P1" into theImageHeight
put the imagedata of image "P1" into theDataToWorkon
if theDataToWorkon = "" then exit mouseUp
put length (theDataToWorkon) into HowLong
put empty into destImageData

-- one Pixel = 4 Bytes = 4 chars
put theImagWidth * 4 into OneRowOfImage
put theImageHeight into soManyPixelRows

put 0 into theCounter
repeat   with i = 1 to (HowLong - OneRowOfImage) step  
(OneRowOfImage*2)
put  char i to (i + OneRowOfImage-1) of theDataToWorkon   
after

destImageData
end repeat

set the width of image "P2" to theImagWidth
-- watch out for images with uneven heigths
set the height of image "P2" to (theImageHeight/2)
set the imagedata of image "P2" to destImageData
end mouseUp

this should give you in "P2" an image half the height of P1 with  
every

second line of the original image.

it works for me, attention, almost no error checking in here,
it is important to have the width and height correct otherwise the  
image

will be distorted

just curious: why do you want to eliminate every second line of an  
image?


hth

Bernd



Josh Mellicker wrote:


Here's one for the image processing gurus out there:

How difficult is it to take an image, and create a new image
containing every OTHER line from it (e.g., just the odd lines) so  
the

resulting picture is half the height?

Once you knew the width of the image, isn't it just a loop that
copies tWidth pixels, then skips the next tWidth, and so on?

Thanks!
___
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




--
View this message in context: http://www.nabble.com/deleting-every- 
other-line-in-an-image-tf4793676.html#a13716667

Sent from the Revolution - User mailing list archive at Nabble.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


___
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


___
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: deleting every other line in an image

2007-11-13 Thread Josh Mellicker

Hello Bernd,

I tried and tried but could not get the script to work.

It produces an image with half the content widthwise, and I am still  
trying to get it to copy every other complete line...


Here is a typical source image:

http://revcoders.org/resources/temp.png

You can see the obvious interlacing, as the dolphin was saying "yes"  
to the question "would you like a fish?"


I am attempting to copy every other line to a new image, then set the  
width to half as well so the picture maintains its aspect ratio.


Does your script work with that image?

Thanks!


On Nov 12, 2007, at 3:34 PM, BNig wrote:



Hi Josh,

make a stack with 2 images, call them "P1" and "P2"
load a picture in the inspector into image "p1"
set the width and height to 140 in the inspector

make a new button

paste this script into the button

on mouseUp
put the width of image "P1" into theImagWidth
put the height of image "P1" into theImageHeight
put the imagedata of image "P1" into theDataToWorkon
if theDataToWorkon = "" then exit mouseUp
put length (theDataToWorkon) into HowLong
put empty into destImageData

-- one Pixel = 4 Bytes = 4 chars
put theImagWidth * 4 into OneRowOfImage
put theImageHeight into soManyPixelRows

put 0 into theCounter
repeat   with i = 1 to (HowLong - OneRowOfImage) step  
(OneRowOfImage*2)

put  char i to (i + OneRowOfImage-1) of theDataToWorkon  after
destImageData
end repeat

set the width of image "P2" to theImagWidth
-- watch out for images with uneven heigths
set the height of image "P2" to (theImageHeight/2)
set the imagedata of image "P2" to destImageData
end mouseUp

this should give you in "P2" an image half the height of P1 with every
second line of the original image.

it works for me, attention, almost no error checking in here,
it is important to have the width and height correct otherwise the  
image

will be distorted

just curious: why do you want to eliminate every second line of an  
image?


hth

Bernd



Josh Mellicker wrote:


Here's one for the image processing gurus out there:

How difficult is it to take an image, and create a new image
containing every OTHER line from it (e.g., just the odd lines) so the
resulting picture is half the height?

Once you knew the width of the image, isn't it just a loop that
copies tWidth pixels, then skips the next tWidth, and so on?

Thanks!
___
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




--
View this message in context: http://www.nabble.com/deleting-every- 
other-line-in-an-image-tf4793676.html#a13716667

Sent from the Revolution - User mailing list archive at Nabble.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


___
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: deleting every other line in an image

2007-11-13 Thread Josh Mellicker

This is correct.

"i" = interlaced
"p" = progressive

Many people shoot in non-interlaced modes nowadays, but some don't,  
and there is "legacy" footage...



On Nov 13, 2007, at 4:05 PM, Luis wrote:


I think 1080i is interlaced, 1080p is not.

Cheers,

Luis.



Stephen Barncard wrote:
And you don't have 1080p available from the source?  That wouldn't  
be interlaced, methinks.

Thanks!

This is exactly what I needed!

just curious: why do you want to eliminate every second line of  
an image?



Video cameras interlace two images taken a fraction of a second  
apart into a single frame, leading to interlacing artifacts (a  
serrated edge on fast moving objects).


Your script will eliminate one of the fields, thereby isolating a  
single "time slice" of reality.


This comes at the expense of 50% loss in vertical resolution.  
Luckily, an HD image has 1080 pixels to start with, so 540 pixels  
vertical is plenty for web use.


Thanks, can't wait to try it!


___
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


___
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: deleting every other line in an image

2007-11-13 Thread Luis

I think 1080i is interlaced, 1080p is not.

Cheers,

Luis.



Stephen Barncard wrote:
And you don't have 1080p available from the source?  That wouldn't be 
interlaced, methinks.




Thanks!

This is exactly what I needed!

just curious: why do you want to eliminate every second line of an 
image?



Video cameras interlace two images taken a fraction of a second apart 
into a single frame, leading to interlacing artifacts (a serrated edge 
on fast moving objects).


Your script will eliminate one of the fields, thereby isolating a 
single "time slice" of reality.


This comes at the expense of 50% loss in vertical resolution. Luckily, 
an HD image has 1080 pixels to start with, so 540 pixels vertical is 
plenty for web use.


Thanks, can't wait to try it!




___
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: deleting every other line in an image

2007-11-13 Thread Stephen Barncard
And you don't have 1080p available from the source?  That wouldn't be 
interlaced, methinks.




Thanks!

This is exactly what I needed!


just curious: why do you want to eliminate every second line of an image?



Video cameras interlace two images taken a fraction of a second 
apart into a single frame, leading to interlacing artifacts (a 
serrated edge on fast moving objects).


Your script will eliminate one of the fields, thereby isolating a 
single "time slice" of reality.


This comes at the expense of 50% loss in vertical resolution. 
Luckily, an HD image has 1080 pixels to start with, so 540 pixels 
vertical is plenty for web use.


Thanks, can't wait to try it!



--


stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -



___
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: deleting every other line in an image

2007-11-13 Thread Josh Mellicker

Thanks!

This is exactly what I needed!

just curious: why do you want to eliminate every second line of an  
image?



Video cameras interlace two images taken a fraction of a second apart  
into a single frame, leading to interlacing artifacts (a serrated  
edge on fast moving objects).


Your script will eliminate one of the fields, thereby isolating a  
single "time slice" of reality.


This comes at the expense of 50% loss in vertical resolution.  
Luckily, an HD image has 1080 pixels to start with, so 540 pixels  
vertical is plenty for web use.


Thanks, can't wait to try it!



On Nov 12, 2007, at 3:34 PM, BNig wrote:



Hi Josh,

make a stack with 2 images, call them "P1" and "P2"
load a picture in the inspector into image "p1"
set the width and height to 140 in the inspector

make a new button

paste this script into the button

on mouseUp
put the width of image "P1" into theImagWidth
put the height of image "P1" into theImageHeight
put the imagedata of image "P1" into theDataToWorkon
if theDataToWorkon = "" then exit mouseUp
put length (theDataToWorkon) into HowLong
put empty into destImageData

-- one Pixel = 4 Bytes = 4 chars
put theImagWidth * 4 into OneRowOfImage
put theImageHeight into soManyPixelRows

put 0 into theCounter
repeat   with i = 1 to (HowLong - OneRowOfImage) step  
(OneRowOfImage*2)

put  char i to (i + OneRowOfImage-1) of theDataToWorkon  after
destImageData
end repeat

set the width of image "P2" to theImagWidth
-- watch out for images with uneven heigths
set the height of image "P2" to (theImageHeight/2)
set the imagedata of image "P2" to destImageData
end mouseUp

this should give you in "P2" an image half the height of P1 with every
second line of the original image.

it works for me, attention, almost no error checking in here,
it is important to have the width and height correct otherwise the  
image

will be distorted

just curious: why do you want to eliminate every second line of an  
image?


hth

Bernd



Josh Mellicker wrote:


Here's one for the image processing gurus out there:

How difficult is it to take an image, and create a new image
containing every OTHER line from it (e.g., just the odd lines) so the
resulting picture is half the height?

Once you knew the width of the image, isn't it just a loop that
copies tWidth pixels, then skips the next tWidth, and so on?

Thanks!
___
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




--
View this message in context: http://www.nabble.com/deleting-every- 
other-line-in-an-image-tf4793676.html#a13716667

Sent from the Revolution - User mailing list archive at Nabble.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


___
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: deleting every other line in an image

2007-11-12 Thread Chipp Walters
You can try the resizequality property of an image:

set the resizequality of img 1 to "best" --> BILINEAR INTERPOLATION
set the resizequality of img 1 to "normal" --> NEAREST NEIGHBOR

On Nov 12, 2007 6:50 PM, Josh Mellicker <[EMAIL PROTECTED]> wrote:

>
>
> I wonder if there is a way to use some kind of crude  "nearest
> neighbor" resizing method where I can resize to 50%, that will not
> blend the lines but just throw away every other one.
>
>
>
___
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: deleting every other line in an image

2007-11-12 Thread Jim Ault
On 11/12/07 4:50 PM, "Josh Mellicker" <[EMAIL PROTECTED]> wrote:

> I wonder if there is a way to use some kind of crude  "nearest
> neighbor" resizing method where I can resize to 50%, that will not
> blend the lines but just throw away every other one.
Wilhelm Sanke has an amazing set of image filters (could be more than 100)
available in his stacks.


--- his post from Sept 2007 -
Sub-button "import image real size" of the menu of btn "import image"
contains a reference to a deleted button "reset imported image unc" and
therefore triggers an error dialog.

Please, delete the last word "unc" (and the space before "unc") of the
wrong button name in the relevant 4 lines of the script or download the
corrected version 2 from


Sorry for the inconvenience. I dislike such hastily produced bugs,
although I seem to be in good company considering the number of new bugs
introduced especially with pre- or beta-releases of some programs.

"unc" stands for "uncompressed". I had tried to find out the speed
difference of retrieving an image from a custom property using
"compressed" vs. "uncompressed" imagedata. The result is that resetting
an image from uncompressed data is faster for image sizes < 1024,
whereas from >1024 on compressed data are faster.

Regards,

Wilhelm Sanke

-
Jim Ault
Las Vegas



On 11/12/07 4:50 PM, "Josh Mellicker" <[EMAIL PROTECTED]> wrote:

> 
> On Nov 12, 2007, at 4:32 PM, François Chaplais wrote:
> 
>> 
>> Le 13 nov. 07, à 01:05, Jim Ault a écrit :
>> 
>>> Why not use the Thumbnail Stack that Eric Chatonet has on his
>>> tutorial page?
>>> Just use 1/2 * the Height and get a smoother jpg since you will be
>>> sampling
>>> to get the smaller image.
>>> 
>> 
>> yes, but the downsizing is probably not performed by the
>> subsampling that Josh wanted (btw, Josh, do you have wavelet or sub-
>> band filtering in mind?)
> 
> Hi François,
> 
> Wow! I don't need those, but it is very impressive if you have
> implemented those algorithms!
> 
> What I am hoping to do is simply throw away every other line and
> construct a new image only consisting of every other line.
> 
> I wonder if there is a way to use some kind of crude  "nearest
> neighbor" resizing method where I can resize to 50%, that will not
> blend the lines but just throw away every other one.


___
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: deleting every other line in an image

2007-11-12 Thread François Chaplais


Le 13 nov. 07, à 01:50, Josh Mellicker a écrit :


Hi François,

Wow! I don't need those, but it is very impressive if you have 
implemented those algorithms!


What I am hoping to do is simply throw away every other line and 
construct a new image only consisting of every other line.


I wonder if there is a way to use some kind of crude  "nearest 
neighbor" resizing method where I can resize to 50%, that will not 
blend the lines but just throw away every other one.




if you have Photoshop (or an app that accepts photoshop plugins), you 
may have a look at a very elementary filtering+subsampling series of 
exercices at

http://cas.ensmp.fr/~chaplais/Photoshop_Wavelet_Workout/index.html

The programming is based is based on adobe's filter factory, and allows 
you to experiment on image processing within photoshop with a very 
simple yet effective programming language.


To come back to Rev, I just discovered that Rev had a "Raw" description 
of images. If I have the time, I will implement the photoshop exercise 
in Rev. The idea is to provide a free demonstration (i.e., it does not 
require Matlab or Photoshop...) Ah!! time.


Best,

Francois Chaplais
35 rue Saint-Honore
77305 Fontainebleau Cedex
France
http://cas.ensmp.fr/~chaplais/


___
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: deleting every other line in an image

2007-11-12 Thread Josh Mellicker


On Nov 12, 2007, at 4:32 PM, François Chaplais wrote:



Le 13 nov. 07, à 01:05, Jim Ault a écrit :

Why not use the Thumbnail Stack that Eric Chatonet has on his  
tutorial page?
Just use 1/2 * the Height and get a smoother jpg since you will be  
sampling

to get the smaller image.



yes, but the downsizing is probably not performed by the  
subsampling that Josh wanted (btw, Josh, do you have wavelet or sub- 
band filtering in mind?)


Hi François,

Wow! I don't need those, but it is very impressive if you have  
implemented those algorithms!


What I am hoping to do is simply throw away every other line and  
construct a new image only consisting of every other line.


I wonder if there is a way to use some kind of crude  "nearest  
neighbor" resizing method where I can resize to 50%, that will not  
blend the lines but just throw away every other one.






No need for all the looping and slow pixel-by-pixel work.


as I said, it's a different algorithm.


Jim Ault
Las Vegas


Francois Chaplais
35 rue Saint-Honore
77305 Fontainebleau Cedex
France
http://cas.ensmp.fr/~chaplais/index-e.html


___
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


___
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: deleting every other line in an image

2007-11-12 Thread François Chaplais


Le 13 nov. 07, à 01:05, Jim Ault a écrit :

Why not use the Thumbnail Stack that Eric Chatonet has on his tutorial 
page?
Just use 1/2 * the Height and get a smoother jpg since you will be 
sampling

to get the smaller image.



yes, but the downsizing is probably not performed by the subsampling 
that Josh wanted (btw, Josh, do you have wavelet or sub-band filtering 
in mind?)



No need for all the looping and slow pixel-by-pixel work.


as I said, it's a different algorithm.


Jim Ault
Las Vegas


Francois Chaplais
35 rue Saint-Honore
77305 Fontainebleau Cedex
France
http://cas.ensmp.fr/~chaplais/index-e.html


___
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: deleting every other line in an image

2007-11-12 Thread Jim Ault
Why not use the Thumbnail Stack that Eric Chatonet has on his tutorial page?
Just use 1/2 * the Height and get a smoother jpg since you will be sampling
to get the smaller image.

No need for all the looping and slow pixel-by-pixel work.

Jim Ault
Las Vegas


On 11/12/07 3:34 PM, "BNig" <[EMAIL PROTECTED]> wrote:

> 
> Hi Josh,
> 
> make a stack with 2 images, call them "P1" and "P2"
> load a picture in the inspector into image "p1"
> set the width and height to 140 in the inspector
> 
> make a new button
> 
> paste this script into the button
> 
> on mouseUp
> put the width of image "P1" into theImagWidth
> put the height of image "P1" into theImageHeight
> put the imagedata of image "P1" into theDataToWorkon
> if theDataToWorkon = "" then exit mouseUp
> put length (theDataToWorkon) into HowLong
> put empty into destImageData
> 
> -- one Pixel = 4 Bytes = 4 chars
> put theImagWidth * 4 into OneRowOfImage
> put theImageHeight into soManyPixelRows
> 
> put 0 into theCounter
> repeat   with i = 1 to (HowLong - OneRowOfImage) step (OneRowOfImage*2)
> put  char i to (i + OneRowOfImage-1) of theDataToWorkon  after
> destImageData
> end repeat
> 
> set the width of image "P2" to theImagWidth
> -- watch out for images with uneven heigths
> set the height of image "P2" to (theImageHeight/2)
> set the imagedata of image "P2" to destImageData
> end mouseUp
> 
> this should give you in "P2" an image half the height of P1 with every
> second line of the original image.
> 
> it works for me, attention, almost no error checking in here,
> it is important to have the width and height correct otherwise the image
> will be distorted
> 
> just curious: why do you want to eliminate every second line of an image?
> 
> hth
> 
> Bernd
> 
> 
> 
> Josh Mellicker wrote:
>> 
>> Here's one for the image processing gurus out there:
>> 
>> How difficult is it to take an image, and create a new image
>> containing every OTHER line from it (e.g., just the odd lines) so the
>> resulting picture is half the height?
>> 
>> Once you knew the width of the image, isn't it just a loop that
>> copies tWidth pixels, then skips the next tWidth, and so on?
>> 
>> Thanks!
>> ___
>> 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
>> 
>> 


___
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: deleting every other line in an image

2007-11-12 Thread BNig

Hi Josh,

make a stack with 2 images, call them "P1" and "P2"
load a picture in the inspector into image "p1"
set the width and height to 140 in the inspector

make a new button

paste this script into the button

on mouseUp
put the width of image "P1" into theImagWidth
put the height of image "P1" into theImageHeight
put the imagedata of image "P1" into theDataToWorkon
if theDataToWorkon = "" then exit mouseUp
put length (theDataToWorkon) into HowLong
put empty into destImageData

-- one Pixel = 4 Bytes = 4 chars
put theImagWidth * 4 into OneRowOfImage
put theImageHeight into soManyPixelRows

put 0 into theCounter
repeat   with i = 1 to (HowLong - OneRowOfImage) step (OneRowOfImage*2)
put  char i to (i + OneRowOfImage-1) of theDataToWorkon  after
destImageData
end repeat

set the width of image "P2" to theImagWidth
-- watch out for images with uneven heigths
set the height of image "P2" to (theImageHeight/2)
set the imagedata of image "P2" to destImageData
end mouseUp

this should give you in "P2" an image half the height of P1 with every
second line of the original image.

it works for me, attention, almost no error checking in here, 
it is important to have the width and height correct otherwise the image
will be distorted

just curious: why do you want to eliminate every second line of an image?

hth

Bernd



Josh Mellicker wrote:
> 
> Here's one for the image processing gurus out there:
> 
> How difficult is it to take an image, and create a new image  
> containing every OTHER line from it (e.g., just the odd lines) so the  
> resulting picture is half the height?
> 
> Once you knew the width of the image, isn't it just a loop that  
> copies tWidth pixels, then skips the next tWidth, and so on?
> 
> Thanks!
> ___
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/deleting-every-other-line-in-an-image-tf4793676.html#a13716667
Sent from the Revolution - User mailing list archive at Nabble.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