Pixel Edge Extension
Hi,
I'm trying to extend the edges of a number of images to give myself extra bleed room for print. The images have bits that are a little too near the edge and I need more room. The effect I'm looking for is repeating the final edge row of pixels for 1/8 of an inch beyond the original image on all side.
The obvious solution, manually repeating the row of pixels is too time consuming for the number of images I need to format.
The solution would have been simple if the imbeciles at adobe hadn't moved the "extend edges" option to the Oh-So-Useful auto lens correction tab in the lens correction filter. (how I HATE thee, Adobe)... Alas, I'm using CS5 and need an alternative soultion.
Any help would be appreicated.
Trevor.Dennis, unfortunately, because of the nature of the files (a combination of image and graphic) content aware fill creates a jumble of unusable content. Thanks for the tip though . I need 40 pixels extra on each edge
Similar Messages
-
Downloaded correct version of Pixel Bender, installed it, tried to open Extension Manager which opens but no programs or files listed, nothing available, install button / choice greyed out, unable to do anything but click to open sales page (aka Exchange). Downloaded/reinstalled Extension manager, still blank options, nothing happens when I CMD-O now what?
Thanks. That worked. I had not gone to the .exe part of the file to apply the "run as administrator".
Doug
If you don't know where you are going, any road will get you there. -
Pixel Bender\Extension Manager Permission Question in Windows 7
I recently migrated to Windows 7 (64Bit) and am using CS4.
I tried to install the Pixel Bender 64Bit plug-in I downloaded but always get a message in Adobe Extension Manager that reads:
"You do not have the appropriate permissions required to perform this operation. Contact your system administrator to obtain permission."
I am my own administrator so I'm not sure what I am doing wrong. I know there are issues between Adobe and Microsoft but like with Acrobat isn't there a "by-pass" until things are sorted out?
Pixel Bender worked fine under Windows XP 32Bit.
I'd appreciate any gudance.
Thanks.
Respectfully,
BAZRight click on the extension manager shortcut and choose Run as Adminstrator
and then navigate to the pixel bender installer from within the extension manager
to install the pixel bender plugin.
MTSTUNER -
Brushes have pixelated edge: when filled with color there's a white line at the border
Hello,
I'm trying to make geometric shapes that are black outlines filled with color. I'm drawing the shapes with the pen tool. When I fill them using the bucket tool, there's a pixellated white line separating the black outline and the color infill. How to do make the color fill directly to the black outline?
Thanks for your help,
DJ
CS4
OS 10.5.8In addition to Chris's post wanted to advise you that stroke effects in Phothsop have rounded edges in Phothoshop. You will notice this on thin strokes (eg: 1 pxl).
Set the stroke to go on inside for squared edges, not center or outside. Adobe has been aware of this since CS, but has not been find a solution for Photoshop to handle this. -
My vector drawings in illustrator cs3 look pixelated plz see screenshot
**** Notice the side of the girls hair its very serrated and somewhat blurry as well look down at her arm at the very bottom
I am using a mac os x version 10.5.8 and have been using Illustrator cs3 that I purchased for about 2 years and its never had this problem till now. I've just recently noticed a few days back that my vector drawings created in illustrator are looking serrated on the edges of my drawing, and this jagged serrated line goes all along the sides of the vector image and doesn't seem to go away when I zoom in or out......
And from what I know vector drawings created in illustrator can be resized and never pixelate but i don't know why its doing this.
I've searched online for all the possible remedies but nothing seems to get rid of that serrated line which makes my images look fuzzy on the sides.
I've made sure that I'm in preview and not pixel preview but that didn't work.
I went to my illustrator preferences to make sure that anti-aliasing is checked but that didn't seem to fix it either.
I went under the effects menu and clicked on Document Raster Effect Settings and changed that to 300ppi but that didn't do it either.
And also when I take my vector drawing from illustrator into photoshop, the serrated lines become more evident. I don't know what to do. The strange thing is that when i print the images out from my printer, the serrated edges don't show up.
But here's the thing: when I open up my past work that I created in illustrator when I wasn't having this problem, for some reason they are also now showing up with that serrated line on the edges, its really weird!!!!!
I've tried everything except for reinstalling the software, but just wanted to know if someone could help me before I tried this step or knew of something that might have gone wrong.
I also downloaded illustrator trial version cs5 today, and its doing the same thing as my illustrator cs3!!!!
Plz help!!!I was experiencing the exact same thing in Illustrator CS5. There was a pixelated edge on a vector drawing that was showing up. At first I assumed it was an anti aliasing setting or pixel preview or document raster settings as you did. Then because all else failed I was about to assume it was a screen artifact or bug of some kind.
However, the upon further analysis I found the solution-and it was right under my nose. I had applied an effect to the vector object (an outer glow) and–because I was going to scale it down drastically from the size I had originally drawn it at –I had gone to the object menu and expanded the appearance of the object which caused my outer glow effect to become a rasterized shape underneath my original object.
To remedy this: I simply zoomed in on the pixlelated object, selected it, ungrouped it, selected the top vector object path, nudged it to the right–REVEALING THE RASTERIZED SHAPE BENEATH!
So I would reccomend you try two things:
First select the view menu and choose "Outline" (command or control Y), then look to see if you have any solid "blocks" -this could indicate a rasterizing of some sort has taken place underneath your vector objects. To get back to regular display just choose "overprint from the view menu.
Secondly, you could select the vector object that appears pixelated and then check in the "Appearance Panel" to see if an effect (such as a drop shadow or outer glow) has been applied ,possibly inadvertently. Because just the applying of an effect will cause a "pixelated, jaggy edge" when viewed at high zoom percentages, or indeed any resolution for that matter.
Hope this helps- -
I get this message consistenly on all attempts: either installing pixel bender in extension manger as well as launching xmp plug in by itself.
"You do not have appropriate permissions required to perform this operation. Contact your system administrator to obtain permission."
I tried this:
the "Is -alFod" procedure in the terminal.app;
Re: Pixel Bender... I do not have the appropriate permission...
1. Open the Utilities directory within the Applications directory.
2. Launch the application, "Terminal.app."
3. Type "ls -alFod " (case is important and note the space at the end) in the terminal but do not press enter/return.
4. Drag and drop the Pixel Bender Extension Manager package, "pixelbenderplugin_p2_64bit_090910.mxp," onto the window in "Terminal.app."
5. Press enter/return.
6. Copy the contents of the window and report them here.
gives me this result:
Last login: Mon Mar 30 21:39:01 on console
CatiMac:~ cat$ Is -alFod /Users/cat/Downloads/pixelbenderplugin_p2_64bit_090910.mxp
-bash: Is: command not found
am on iMac OS X 10.5.8; a solution would be great!
35. Mar 23, 2011 10:29 PM in response to: n0_b0dy
Re: Pixel Bender... I do not have the appropriate permission...
It's not clear to me how you can get into a state where the ls command cannot be found. Do you have admin rights on your mac? Regardless, please start a new thread, with details about the problem you're encountering. Thanks.
My admin rights is to an extent that i can bequeath the unit to anyone as I please.
Problems encountered is as stated on the first post, exactly like the problems encountered as posted by Brabusa60's; and the Is -alFod procedure at Terminal.app returns an unlikely response.Sorry for the untimely response. I had internet troubles.
here are the terminal.app the output for these:
ls -alFo ~/Library/Application\ Support/Adobe/
ls -alFo ~/Library/Application\ Support/Adobe/Extension\ Manager\ CS5/
ls -alFo /Applications/Adobe\ Photoshop\ CS5/
Last login: Mon Apr 13 21:13:57 on console
CatiMac:~ cat$ ls -alFo ~/Library/Application\ Support/Adobe/
total 0
Even though I had read write permission then I was only able to succesfully install after I enabled "root" user.
nevertheless, thank you for responding -
Crop tool precision - can it snap to whole pixels?
One thing that drives myself and every other designer I know crazy in Photoshop are tools that do not allow precisie snapping to the edges of whole pixels This is not such a problem with printed media and there are valid reasons to allow certain tools to snap to the midpoint of a pixel and it is nice to have the option to turn that on and off. However as a web designer I have a problem that has been getting on my nerves for several years and maybe there is another way I could approach this I am not thinking of.
Aside from templates where I can spend the time to create slices and export them as such, most often I am working on graphics that require me to select an area and crop / save for web on the fly.
Here is the problem.
The Crop Tool does not snap to whole pixels, or guides, or document bounds very precisely at all. Compare snapping to guides with a standard marquee box vs the crop tool and you will see what I mean. The marquee snaps with gusto, while you never really know if the crop tool is sitting halfway across a pixel without zooming far in (and even then I am not sure). The marquee ALWAYS selects whole pixels and cannot select a "half pixel" regardless of how much you try.
Because of this, I am forced to use the Marquee tool to select my area for cropping and using the "crop" command from the menu since it is the only way to crop with the marquee. However, the problem with THIS method is that photoshop does not preserve your layered content outside of those bounds. Therefore any Layer Effects (especially shadows) are changed drastically to the point where shadows do not line up across multiple slices (if individually exporting them this way).
Sometimes I am re-adjusting an ad layout to another size, and need to crop without losing the content outside of those bounds. Sometimes I just need to keep shadows etc intact. Sometimes I need that content outside the bounds for motion graphics purposes etc.
This is all just a bunch of hot air to essentially say I cannot find a way to EASILY crop, snapping to precise pixels AND keep the content outside of the new document bounds intact for further manipulation in a layered document.
Is there a way to do this I am not thinking about? Can you make the crop tool snap to whole pixels and/or force the crop command in the menu to follow the same preference setting you gave the crop tool in terms of keeping the content outside of your new bounds from being deleted?
I'd appreciate any suggestions on this.
If Adobe actually reads this stuff, I can assure that EVERY SINGLE photoshop artist I have ever talked to about this has the exact same complaint. I know hundreds of people who hate this (even the non-web designers who don't need as much pixel precision).It never really hampers my productivity but this morning I had to crop an ad down to a smaller size and just started thinking of this...
I always drag a marquee selection out (box) when I need to add a guide to my document to ensure that my guides snap to the pixel edge.
One thing I just did that seemed to work with the crop tool well was setting the grid settings to a gridline every 10px with 10 subdivisions in preferences and then turning on the grid when using the crop tool. It does not seem to snap unless you are actually viewing the grid but the tool snaps to individual pixels.
Typically in my normal work flow when I am in the zone and just doing things without thinking, I drag a marquee around to set my guides for cropping, then draw a marquee box snapping to those guides, flatten image to make sure layer effects stay intact, crop, save, use history window to go back to un-flattened state, move on...
It would be cool to be able to use the crop command after drawing the marquee without destroying the layer content outside the new bounds, even a seperate command that adjusts the "canvas size" to the marquee bounds would be fine.
Its not something I consider to be broken but honestly when I deal with designers who are not web developers, one of the major issues I get with PSDs that need to be chopped up for a web site is pixels not being precicise and boxes being drawn with half-pixels and guides sitting in the middle of pixels. It is indicitave of something that could be improved for my own productivity sake AND to help designers keep things snappy and tight in their comps.
I've had to re-build countless nav-bars, and other elements because of blurry pixels, non-precisely measured spacings, etc etc to ever count. But at the same time it is good to have something to be paid for LOL. -
Yes has anybody had any trouble downloading Pixel bender using CS5 extension manager? I keep geting the message I do not have administrative permissions. Even though I have all administrative permissions on my ImacG5 10.6.7. Is there a way around this or has anybody have the anaswer.
yes I had no trouble downloading pixel bender from the web. As administrator of my computer I should have no problem installing, but no matter what I do keeps telling me I do not have administrative permissions.
========================================================================================== =======================================
Date: Mon, 6 Jun 2011 21:12:05 -0600
From: [email protected]
To: [email protected]
Subject: Installing Pixel bender
Just to be clear, I assume by "downloading" you mean you're seeing this problem when installing the Pixel Bender extension via Extension Manager, correct? You were able to successful download the Pixel Bender extension from the web, correct?
> -
Resolution problems with LR4 and Blurb
I am using RAW files and trying to make a Blurb book with full bleed pages. The warning indicator keeps prompting me that the resolution is less than the 200ppi minimum needed for the full size page. I thought with RAW files I would have plenty of data to make a full page image in a large (11x13) book.
You can do the math: 11 inch with 200 pixels per inch need 2200 pixel edge. 13 inch need 2600 pixels minimum.
Do you mean 2-page-spreads? Then it would need 22 inch x 13 inch, hence 4400x2600.
You will see your image dimensions in the metadata panel.
Did you crop some image below that?
What resolution has your camera, which native ratio?
If your values should fit, I would expect some bug in the book module.
Cornelia -
Hardware recommendations for capturing VHS / RCA composite better than Hauppauge USB?
Hi folks,
I am trying to archive our old VHS tapes (NTSC 720x480 29.97 fps). I am using a $45 Hauppauge USB-Live-2 Video Capture. It's certainly adequate to see what's happenning in general, but it's also not as good as one would see e.g. playing these tapes on a TV. In particular, the right side of the image is missing some pixels (as though the right-most 20 or so pixels are blacked out, all up and down the right edge). Quite possibly, there are other subtler problems.
FWIW, I am doing the initial capture with AVS Video Recorder (to UYVY AVI format), then importing this (DV NTSC 720x480 29.97 fps) to PE11 and exporting to DV NTSC 720x480 29.97 fps MP4. PE11's MP4s are about 30% the size of the AVS AVIs.
Bill Hunt here recommended looking into DV Bridges (thanks, Bill!). However, I am not entirely sure what to look for. I found some Canopus devices on NewEgg, but they are $170, $200, or more. I'm not sure it's worth $200 just to save a 20-pixel edge on approximately 30 home videos. Anyway, can anyone point me toward hardware that works well with PE11 and VHS composite?
Thanks if you can help!
MikeYou get what you pay for.
I have been using a Canopus ADVC100 for almost 10 years, and have had 100% success right out of the box the first time I used it. As noted above the model 55 (which wasn't available when I bought my unit) should be all you need.
Before I got the Canopus unit I tried several 'cheaper' (USB) devices but never got satisfactory repeatable reuslts. Be sure you have at least a Firewire 400 connection. If you need to add such a port make sure the device uses a TI chip to avoid conversion problems. I purchased a " Syba Low Profile PCI-Express 1394b/1394a (2B1A) Card, TI Chipset, Extra Regular Bracket SD-PEX30009 " (which has both FW 400 & 800 ports) apprx $26 from Amazon.
By the way I use the Canopus to convert/capture both VHS and Hi8 analog tapes. -
Safari 3 - Dual-monitor problem.
I've just installed Safari on Windows Vista Business. When I move the windows on my secondary monitor, a soon as I try to maximize it, it desappear. The program is still in my taskbar, but I can't minimize or anything. The options are greyed-out. The only thing I can do is to kill Safari and restart it.
Is anyone has experiencing the same problem ?
DELL Inspiron 6000 Windows VistaI've just tested Safari on a multihead Windows XP system and suffered the same problem. Display 1 is laptop primary display, and display 2 is configured to the left of laptop display and is an external LCD.
If you right click on the Safari button in the TaskBar and select Move, the cursor appears at the top left hand corner of display 2, and I think I can see a one pixel edge down the left hand side of display 2 that may be the Safari window. It starts a few pixels down from the top left and appears to be black 1px wide, and when you close Safari it disappears.
HP Compaq nx9110 Windows XP Pro -
How can I prevent pixelization during opacity change?
I am creating a small WMV ( 197x148 ) which includes a static image and a video clip. I am encountering 2 problems:
Video has a pixelated edge
Video opacity change is pixelated, and not smooth
Any help appreciated - what surprised me is that during the fast preview they look fine, but when they render they get janky. Is there a dithering option I need to disable or somesuch?!
Thanks in Advance!!!Thanks - I tried to include my timeline large enough to read in the second image.
I adjusted the layer blending property under LAYER -> BLENDING MODE -> NORMAL and this resolved my issue!
Thanks so much! -
Alert Control - Background Color
Hi everybody,
I've been trying to change the background color of the Alert
Control.
The only thing that I got close to, what using the
myAlert.setStyle("backgroundColor",......). However, it only
changed the
inner background, not the background of the main Alert. Can
somebody point
me in the right direction?
Thanks,
JGWell, that was actually quite simple. I was exploring the
classes and their
parents, it was getting a little confusing. Then I started
inspecting the
Alert box created. I noticed I has getting 3 children being
created:
[INFO] Alert6.border (object):
[INFO] Alert6.UIComponent8 (object):
[INFO] Alert6.AlertForm14 (object):
so I started looking at the border class, then programmatic
skin etc... Long
story short, I went back to the doc on the Alert control,
there are actually
several styles related to border, it's quite misleading
because it actually
related to this 20 pixel edge around the content of the
alert. So with a
combination of border styles and background styles you can
actually get your
control to look the way you want. Here is my code:
var myAlert:Alert = Alert.show("An error occured while
loading from the
server.", "Error", Alert.YES, this);
myAlert.setStyle("borderColor", "#75734f");
myAlert.setStyle("backgroundColor", "#75734f");
And actually, from the doc:
BorderAlpha - Alpha of the title bar, control bar and sides
of the Panel.
just need to take time to read the doc sometimes.... ;-)
"phi2265" <[email protected]> wrote in
message
news:erkr54$60r$[email protected]..
> have you figured this out yet? you can't call
AlertMsg.parent.setStyle
> like you can AlertMsg.setStyle -
Hallo,
I edited an image in Photoshop. It has a height of 578 pixels and is 1120 pixel wide. The pixel-edge-ratio is set to D1/DV Pal (1,066). I am working with the german versions of those applications, so excuse me if some of the commands and labels are not translated correctly.
I thought I could import the image into Encore DVD 2.0, set its scaling to "scale and crop" and than choose a pan e.g. from west to east on it.
But if I import the image and use it in a slideshow, even without scaling its already bigger than the monitor area. I thought if I set the scaling to "scale and crop", it would be resized in either direction until the height or the width fit exactly into the monitor, and the rest is cropped.
But it seems that this applies only if the width or the height of the image is smaller than the monitors width or height. In that case, "scale and crop" makes the image bigger until it fits in the described way. If the image is already bigger, it won't be shrinked to fit.
But my initial question is: Why is the image's height bigger than the monitor's height if I set the image height to 578 pixels?
Then I found out that this is connected with the pan & zoom settings. Of course my image is much wider than the monitor, that's because I wanted to pan it from west to east. If I deselect the pan, suddenly the image is scaled in the correct way. Now I just want it to have exactly this size, but be panned from west to east. But as soon as I choose pan (without zoom), Encore DVD 2.0 makes it bigger. That leads to important areas of the image being cropped.
Can somebody explain to me why that is. Why is a panned image scaled different than a zoomed one?
Regards,
Christian KirchhoffChain,
There's scaling in the Print Dialog...
It there some other type of Scaling that you are looking for?
Jerry -
Another trick of using array and getpixel
Hi,
this is my reference to get Median 5 x 5px (Horizontal and Vertical Diverence Value)
this is my code,.
public static int[] limitMed(Bitmap myBmp)
//Input: Bitmap 68 x 68px (Grayscale)
//Output: Array of Median 5 x 5px (Horizontal and Vertical Diverence Value) - Just like the picture
//Ignore 2px to each sides (i just need 64 x 64px inside)
int[] myValue = new int[(myBmp.Width - 4) * (myBmp.Height - 4)];//Array for Output Value
int[] tempHValue = new int[20];//Array for Horizontal Diverence Value
int[] tempVValue = new int[20];//Array for Vertical Diverence Value
int countV = 0;// Count Value
for (int j = 2; j < myBmp.Height - 2; j++)//Ignore 2px top and bottom side
for (int i = 2; i < myBmp.Width - 2; i++)//Ignore 2px left and right side
int countHT = 0;
for (int y = j - 2; y <= j + 2; y++)
for (int x = i - 2; x < i + 2; x++)
Color myClr1 = myBmp.GetPixel(x, y);
Color myClr2 = myBmp.GetPixel(x + 1, y);
tempHValue[countHT] = Math.Abs(myClr1.R - myClr2.R);//Get horizontal diverence value
countHT++;
List<int> listH = new List<int>(tempHValue);//Add horizontal diverence value to List
int countVT = 0;
for (int y = i - 2; y <= i + 2; y++)
for (int x = j - 2; x < j + 2; x++)
Color myClr1 = myBmp.GetPixel(y, x);
Color myClr2 = myBmp.GetPixel(y, x + 1);
tempVValue[countVT] = Math.Abs(myClr1.R - myClr2.R);//Get vertical diverence value
countVT++;
List<int> listV = new List<int>(tempVValue);//Add vertical diverence value to List
var result = listH.Concat(listV);//Combine Lists
List<int> resultList = result.ToList();
resultList.Sort();//Sort List
List<int> rangeList = resultList.GetRange(19, 2);//Get 19th and 20th value
myValue[countV] = (int)rangeList.Average();//Add Median to Array
countV++;
return myValue;// return Array
this code is running but not too fast,
there is any idea to repair this code?
Thanks!//////////////////////// // TODO: Your per-pixel code here. // The pixel contains 8-bit non-linear (sRGB) data. // See wikipedia: http://en.wikipedia.org/wiki/SRGB // for conversions betwen sRGB and Linear RGB. // Do your arithmetic on linear RGB values
only.
// pixel[0]: (sRGB) RED value
// pixel[1]: (sRGB) GREEN value
// pixel[2]: (sRGB) BLUE value
//////////////////////// pixel += bytesPerPixel;
} } ); } myBitmap.UnlockBits( bmdata );
Hi,
afaik the order is reversed BGR format so p[0] is blue - at least for 32bppArgb locked bmps.
Here's my Median Filter for Bitmaps using unsafe code (This does something else than the OPs code, it doesnt "middle" the differences but the color channel values - as a Filter for images, can be optimized)
private void button1_Click(object sender, EventArgs e)
MedianFilter((Bitmap)this.pictureBox1.Image, 9 /* 9x9 Kernel */, true /* if pic doesnt contain transparecy, set this to false */, 255, null);
this.pictureBox1.Refresh();
//Median Filter, processing all pixels (edge/near-edge values too)
//Conveniant, fast, but not fastest implementation (due to the variable size of the kernel to imput into the method).
//params:
//InputBitmap,
//KernelSize,
//take median for alpha channel,
//maxSize of KernelRow/Column,
//a reference to a BackgroundWorker to cancel/stop the opertation
public static bool MedianFilter(Bitmap bmp, int size, bool doTrans, int maxSize, System.ComponentModel.BackgroundWorker bgw)
if ((size & 0x1) != 1)
throw new Exception("Kernelrows Length must be Odd.");
if (size < 3)
throw new Exception("Kernelrows Length must be in the range from 3 to" + (Math.Min(bmp.Width - 1, bmp.Height - 1)).ToString() + ".");
if (size > maxSize)
throw new Exception("Kernelrows Length must be in the range from 3 to" + maxSize.ToString() + ".");
if (size > Math.Min(bmp.Width - 1, bmp.Height - 1))
throw new Exception("Kernelrows Length must be in the range from 3 to" + (Math.Min(bmp.Width - 1, bmp.Height - 1)).ToString() + ".");
int h = size / 2;
Bitmap bSrc = null;
BitmapData bmData = null;
BitmapData bmSrc = null;
try
bSrc = (Bitmap)bmp.Clone();
bmData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
bmSrc = bSrc.LockBits(new Rectangle(0, 0, bSrc.Width, bSrc.Height),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
System.IntPtr SrcScan0 = bmSrc.Scan0;
unsafe
int nWidth = bmp.Width;
int nHeight = bmp.Height;
int llh = h * stride;
int lh = h * 4;
# region First Part
for (int l = 0; l < h; l++)
byte* p = (byte*)(void*)Scan0;
byte* pSrc = (byte*)(void*)SrcScan0;
int lf = l * stride;
int ll = l * 4;
byte[] red = new byte[(h + 1) * (h + l + 1)];
byte[] green = new byte[(h + 1) * (h + l + 1)];
byte[] blue = new byte[(h + 1) * (h + l + 1)];
byte[] alpha = new byte[(h + 1) * (h + l + 1)];
int mid = red.Length / 2;
for (int r = h - l, rc = 0; r < size; r++, rc++)
int lr = rc * stride;
for (int c = h, cc = 0; c < size; c++, cc++)
int lcc = cc * 4;
blue[rc * h + cc] = pSrc[lr + lcc];
green[rc * h + cc] = pSrc[1 + lr + lcc];
red[rc * h + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[rc * h + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += lf;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
for (int x = 1, ccc = 1; x < nWidth - 1; x++, ccc++)
p = (byte*)(void*)Scan0;
pSrc = (byte*)(void*)SrcScan0;
if (x > size - (h + 1))
p += (x - size + (h + 1)) * 4;
pSrc += (x - size + (h + 1)) * 4;
ccc = (bmp.Width - x >= h + 1) ? Math.Min(ccc, h) : bmp.Width - x - 1;
int fc = (h + ccc + 1);
red = new byte[fc * (h + l + 1)];
green = new byte[fc * (h + l + 1)];
blue = new byte[fc * (h + l + 1)];
alpha = new byte[fc * (h + l + 1)];
mid = red.Length / 2;
for (int r = h - l, rc = 0; r < size; r++, rc++)
int lr = rc * stride;
for (int c = Math.Max(h - x, 0), cc = 0; (x - h + size <= bmp.Width) ? c < size : c < (size - (x - h + size - bmp.Width)); c++, cc++)
int lcc = cc * 4;
blue[rc * fc + cc] = pSrc[lr + lcc];
green[rc * fc + cc] = pSrc[1 + lr + lcc];
red[rc * fc + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[rc * fc + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p = (byte*)(void*)Scan0;
p += lf + (x * 4);
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
p = (byte*)(void*)Scan0;
p += (nWidth - h - 1) * 4;
pSrc = (byte*)(void*)SrcScan0;
pSrc += (nWidth - h - 1) * 4;
red = new byte[(h + 1) * (h + l + 1)];
green = new byte[(h + 1) * (h + l + 1)];
blue = new byte[(h + 1) * (h + l + 1)];
alpha = new byte[(h + 1) * (h + l + 1)];
mid = red.Length / 2;
for (int r = h - l, rc = 0; r < size; r++, rc++)
int lr = rc * stride;
for (int c = 0, cc = 0; c < size - h; c++, cc++)
int lcc = cc * 4;
blue[rc * h + cc] = pSrc[lr + lcc];
green[rc * h + cc] = pSrc[1 + lr + lcc];
red[rc * h + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[rc * h + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += lf + lh;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
# endregion
# region Main Body
//for (int y = 0; y < nHeight - size + 1; y++)
Parallel.For(0, nHeight - size + 1, (y, loopState) =>
byte* p = (byte*)(void*)Scan0;
byte* pSrc = (byte*)(void*)SrcScan0;
if (bgw != null && bgw.CancellationPending)
loopState.Break();
# region First Pixels
byte[] red = new byte[(h + 1) * size];
byte[] green = new byte[(h + 1) * size];
byte[] blue = new byte[(h + 1) * size];
byte[] alpha = new byte[(h + 1) * size];
int mid = red.Length / 2;
for (int l = 0; l < h; l++)
p = (byte*)(void*)Scan0;
p += y * stride;
pSrc = (byte*)(void*)SrcScan0;
pSrc += y * stride;
int ll = l * 4;
for (int r = 0, rc = 0; r < size; r++, rc++)
int lr = rc * stride;
for (int c = 0, cc = 0; c < (h + 1); c++, cc++)
int lcc = cc * 4;
blue[r * (h + 1) + cc] = pSrc[lr + lcc];
green[r * (h + 1) + cc] = pSrc[1 + lr + lcc];
red[r * (h + 1) + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[r * (h + 1) + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += llh + ll;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
# endregion
# region Standard
red = new byte[size * size];
green = new byte[size * size];
blue = new byte[size * size];
alpha = new byte[size * size];
mid = red.Length / 2;
for (int x = 0; x < nWidth - size + 1; x++)
p = (byte*)(void*)Scan0;
p += y * stride + x * 4;
pSrc = (byte*)(void*)SrcScan0;
pSrc += y * stride + x * 4;
for (int r = 0; r < size; r++)
int llr = r * stride;
for (int c = 0; c < size; c++)
int lc = c * 4;
blue[r * size + c] = pSrc[llr + lc];
green[r * size + c] = pSrc[1 + llr + lc];
red[r * size + c] = pSrc[2 + llr + lc];
if (doTrans)
alpha[r * size + c] = pSrc[3 + llr + lc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += llh + lh;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
# endregion
# region Last Pixels
red = new byte[(h + 1) * size];
green = new byte[(h + 1) * size];
blue = new byte[(h + 1) * size];
alpha = new byte[(h + 1) * size];
mid = red.Length / 2;
for (int l = nWidth - size + 1; l < nWidth - h; l++)
int ll = l * 4;
p = (byte*)(void*)Scan0;
p += (y * stride) + ll;
pSrc = (byte*)(void*)SrcScan0;
pSrc += (y * stride) + ll;
for (int r = 0, rc = 0; r < size; r++, rc++)
int lr = rc * stride;
for (int c = 0, cc = 0; c < h + 1; c++, cc++)
int lcc = cc * 4;
blue[r * (h + 1) + cc] = pSrc[lr + lcc];
green[r * (h + 1) + cc] = pSrc[1 + lr + lcc];
red[r * (h + 1) + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[r * (h + 1) + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += llh + lh;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
# endregion
# endregion
# region Last Part
for (int l = 0; l < h; l++)
byte* p = (byte*)(void*)Scan0;
byte* pSrc = (byte*)(void*)SrcScan0;
p += (nHeight - size + l + 1) * stride;
pSrc += (nHeight - size + l + 1) * stride;
int lf = l * stride;
int ll = l * 4;
byte[] red = new byte[(h + 1) * (size - l - 1)];
byte[] green = new byte[(h + 1) * (size - l - 1)];
byte[] blue = new byte[(h + 1) * (size - l - 1)];
byte[] alpha = new byte[(h + 1) * (size - l - 1)];
int mid = red.Length / 2;
for (int r = 0, rc = 0; r < size - (l + 1); r++, rc++)
int lr = rc * stride;
for (int c = h, cc = 0; c < size; c++, cc++)
int lcc = cc * 4;
blue[rc * h + cc] = pSrc[lr + lcc];
green[rc * h + cc] = pSrc[1 + lr + lcc];
red[rc * h + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[rc * h + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += llh;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
for (int x = 1, ccc = 1; x < nWidth - 1; x++, ccc++)
p = (byte*)(void*)Scan0;
p += (nHeight - size + l + 1) * stride;
pSrc = (byte*)(void*)SrcScan0;
pSrc += (nHeight - size + l + 1) * stride;
if (x > size - (h + 1))
p += (x - size + (h + 1)) * 4;
pSrc += (x - size + (h + 1)) * 4;
ccc = (bmp.Width - x >= h + 1) ? Math.Min(ccc, h) : bmp.Width - x - 1;
int fc = (h + ccc + 1);
red = new byte[fc * (size - l - 1)];
green = new byte[fc * (size - l - 1)];
blue = new byte[fc * (size - l - 1)];
alpha = new byte[fc * (size - l - 1)];
mid = red.Length / 2;
for (int r = 0, rc = 0; r < size - (l + 1); r++, rc++)
int lr = rc * stride;
for (int c = Math.Max(h - x, 0), cc = 0; (x - h + size <= bmp.Width) ? c < size : c < (size - (x - h + size - bmp.Width)); c++, cc++)
int lcc = cc * 4;
blue[rc * fc + cc] = pSrc[lr + lcc];
green[rc * fc + cc] = pSrc[1 + lr + lcc];
red[rc * fc + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[rc * fc + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p = (byte*)(void*)Scan0;
p += (nHeight - size + l + 1) * stride;
p += llh + (x * 4);
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
p = (byte*)(void*)Scan0;
p += (nHeight - size + l + 1) * stride;
p += (nWidth - h - 1) * 4;
pSrc = (byte*)(void*)SrcScan0;
pSrc += (nHeight - size + l + 1) * stride;
pSrc += (nWidth - h - 1) * 4;
red = new byte[(h + 1) * (size - l - 1)];
green = new byte[(h + 1) * (size - l - 1)];
blue = new byte[(h + 1) * (size - l - 1)];
alpha = new byte[(h + 1) * (size - l - 1)];
mid = red.Length / 2;
for (int r = 0, rc = 0; r < size - (l + 1); r++, rc++)
int lr = rc * stride;
for (int c = 0, cc = 0; c < size - h; c++, cc++)
int lcc = cc * 4;
blue[rc * h + cc] = pSrc[lr + lcc];
green[rc * h + cc] = pSrc[1 + lr + lcc];
red[rc * h + cc] = pSrc[2 + lr + lcc];
if (doTrans)
alpha[rc * h + cc] = pSrc[3 + lr + lcc];
Array.Sort(red);
Array.Sort(green);
Array.Sort(blue);
Array.Sort(alpha);
p += llh + lh;
p[0] = blue[mid];
p[1] = green[mid];
p[2] = red[mid];
if (doTrans)
p[3] = alpha[mid];
# endregion
bmp.UnlockBits(bmData);
bSrc.UnlockBits(bmSrc);
bSrc.Dispose();
return true;
catch
try
bmp.UnlockBits(bmData);
catch
try
bSrc.UnlockBits(bmSrc);
catch
if (bSrc != null)
bSrc.Dispose();
bSrc = null;
return false;
Regards,
Thorsten
Maybe you are looking for
-
Issue with MacBook Pro (Not Charging)
I'm not extremely computer savvy with Macs, so bear with me when you give instructions. I've had this 15'' MacBook Pro since 2010 for when I entered college. I've been using it since this year. Up until the last week my charger has been not charging
-
Confused about nonGUI beans and events
The crux of this is the question "When will a NON GUI bean use events to communicate?" Articles I have read advocate that Beans are not just GUI components, and I agree. However I've only ever seen examples of GUI Beans! I am writing a non GUI Bean t
-
I have built an Express Database using AWM that reads data from a relational table, performs some calculations and populates a different relational table. This all works great when I call the program from the OLAP Worksheet. Now I want my JSP page to
-
hi i m trying to install 9i RAC on windows 2000....installation guide realy doesnt work....according to installation guide i created logical drives on my single hard disk and down loaded CLUSTER FILE SYSTEM pack from oracle website.....next step is t
-
Colour Management Problem - Please Help!
I am using Photoshop CS3 I have edited a portrait image in Camera Raw. From Bridge I have used Tools -> Photoshop -> Web Photo Gallery I have taken one of the resulting JPEGS out and it displays absolutely fine in Microsoft applications, and skin ton