w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Python: Combining images using paste with overlapping pixels and areas with alpha channel=0
I think you have a misconception about images - the border image does have pixels everywhere. It's not possible for it to be "missing" pixels. It is possible to have an image with an alpha channel, which is a channel like the R, G, and B channels, but indicates transparency. Try this: 1. Make sure that topImage.png has a transparency channel, and that the pixels that you want to be "missing" are transparent (i.e. have a maximum alpha value). You can double check this way: print old_im.mode # This should print "RGBA" if it has an alpha channel. 2. Create new_im in "RGBA" mode: new_im = Image.new("RGBA", new_size) # makes the black image # Note the "A" --------^ 3. Try this paste statement instead: new_im.paste(old_im,(0,0), mask=old_im) # Using old_im as the mask argument shou

Categories : Python

on blur of input field validate field and cancel blur event if not valid
I asked this question once, these are generally browser features which is not lock down a user to one input box. User should have choice of going away if they wanted, whether or not it is valid. So, Focus the same element after the blur event is disallowed. Edit: It seems chrome browser allows such effect such behavior but firefox and internet explorer does not.

Categories : Javascript

Blur UIImageView with gradient alpha
we did the same in a proyect! we used this method: (UIImage *)blurImage:(CGImageRef*)image withBlurLevel:(CGFloat)blur { CIImage *inputImage = [CIImage imageWithCGImage:image]; CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur" keysAndValues:kCIInputImageKey, inputImage, @"inputRadius", @(blur), nil]; CIImage *outputImage = filter.outputImage; CIContext *context = [CIContext contextWithOptions:nil]; CGImageRef outImage = [context createCGImage:outputImage fromRect:[inputImage extent]]; UIImage *returnImage = [UIImage imageWithCGImage:outImage]; CGImageRelease(outImage); return returnImage; } This code use your GPU to make the blur, but you need to call that method i

Categories : IOS

Button BackColor (seems to) ignore alpha channel
Research says this should work for you, add it to your buttons constructor; this.SetStyle(ControlStyles.SupportsTransparentBackColor, true) http://msdn.microsoft.com/en-us/library/system.windows.forms.control.setstyle.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.controlstyles.aspx

Categories : Vb.Net

Multiply alpha channel in an AARRGGBB color
You need to preserve the rgb values of your pixel. Only multiply the alpha byte of the uint. function multiplyAlpha(color:uint, percent:Number):uint { //returns the pixel with it's aplha value multiplied by percent //percent is expected to be in the range 0..1 var a:uint = (color >> 24) * percent; var rgb:uint = color & 0x00ffffff; return ((a<<24) | rgb); } function setAlphaByPercent(color:uint, percent:Number):uint { //returns the pixel with it's a new alpha value based on percent //percent is expected to be in the range 0..1 var a:uint = 0xff * percent; var rgb:uint = color & 0x00ffffff; return ((a<<24) | rgb); }

Categories : Actionscript

Is alpha channel used when loading JPEG image as ARGB_8888?
I find the answer to this question very dependent to the circumstances you're in. Is there a memory issue, or space, or bandwidth that would deter you from using ARGB_8888? If not, than use it. According to the documentation, It should be used whenever possible. EDIT Since RGB_888 is not a default Bitmap.Config option, but RGB_565 is, which uses 2 bytes compared to 4 as ARGB_8888, you'll end up going back to making your decision based on the circumstances. Are you willing to drop image quality and used memory for the required processing power?

Categories : Android

How to display a TBitmap with alpha channel on TImage correctly?
Your shown code works fine on my system if I use Transparent=false for imgSource. I can reproduce the behavoiur with the black pixels if I load the bitmap from a file. Different setting influence the displaying procedure TForm3.SetAlphaFormatClick(Sender: TObject); begin if SetAlphaFormat.Checked then ToggleImage.Picture.Bitmap.alphaformat := afDefined else ToggleImage.Picture.Bitmap.alphaformat := afIgnored; end; procedure TForm3.SetImageTransparentClick(Sender: TObject); begin ToggleImage.Transparent := SetImageTransparent.Checked; Image1.Transparent := SetImageTransparent.Checked; end; procedure TForm3.LoadPngTransform2BitmapClick(Sender: TObject); Const C_ThePNG = 'C: emp est1.png'; C_TheBitMap = 'C: empTestIn.bmp'; var SourceBitmap, TestBitmap: TBitmap;

Categories : Delphi

Allegro 5 - creating a custom bitmap with alpha channel
The only thing wrong with your code snippet is: al_map_rgba(0, 0, 0, 0.5) should be: al_map_rgba_f(0, 0, 0, 0.5) The former range is an integer from 0 to 255. Also, keep in mind that Allegro's default blender is pre-multiplied alpha. So if you wanted to tint red at 50%, you'd use: float a = 0.5; ... al_map_rgba_f(1.0 * a, 0.0 * a, 0.0 * a, a) ... If you're not thinking about it, you're probably assuming it's interpolating. i.e., the more intuitive blender for most people seems to be: al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA) but that is not the default for the reasons mentioned in the above link.

Categories : C++

Resize png image in Delphi - incorrect alpha channel
I suspect that is caused by 2 things: funny RGBA values in PNG and naive resizing code. You need to check your PNG contents. You are looking for RGB values in transparent areas. Despite transparent areas having Alpha at 0, they still have an RGB info. In your case I would expect that transparent areas are filled with black RGB value. That is what might cause the grey outline after resize if the resize is done naively. Example: What happens if code resizes 2 adjustent pixels (0,0,0,0) and (255,255,255,255) into one? Both pixels contribute by 50% The result is 128,128,128,128) which is semi-transparent grey. Same thing happens when you upscale by e.g x1.5, the added pixel inbetween original two will be grey. Usually that does not happen because image-editing software is smart enough to fill

Categories : Delphi

Transparent PNG with alpha channel parts shows with ugly border
Try this: e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; See also this: How to draw smooth images with C#? Anyway, as another user noted, the issue is with the image which was created without any anti-aliasing. The above snippet will alleviate the problem but the best option is to adjust the image. Regards

Categories : Vb.Net

Missing alpha channel in DXT5 texture on android device
Finally found the problem. OpenGL state of my game was configured to work with premultiplied alpha-channel. I've added special 'premultiply' step to my build system and got proper result. Blend-function settings: glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

Categories : Android

How to get video frames from mp4 video using ffmpeg in android?
compile ffmpeg.c and invoke its main() via jni. For more details see how to Use FFMPEG on Android . Also refer this github project. And this tutorial too will help you. I hope this will help you.

Categories : Android

Masking the alpha channel in Processing.js - making transparent areas in canvas
You are missing this line above your setup() parent.document.getElementById("yourDivID").setAttribute("style", "background-color:transparent; border:0px;"); This will tell the div of the iframe to be set to transparent. Note: be sure to replace "yourDivID" for the real ID of your div.

Categories : Misc

How can one create and then use an alias in a function of a sourced Bash script?
Note that aliases will have limited functionality for scripting. From the Advanced Bash Scripting Guide: In a script, aliases have very limited usefulness. It would be nice if aliases could assume some of the functionality of the C preprocessor, such as macro expansion, but unfortunately Bash does not expand arguments within the alias body. [2] Moreover, a script fails to expand an alias itself within "compound constructs," such as if/then statements, loops, and functions. An added limitation is that an alias will not expand recursively. Almost invariably, whatever we would like an alias to do could be accomplished much more effectively with a function. I would use a variable for this: myFunction(){ zappo="echo" $zappo "foo bar" } Or even a wrapper function: zappo() {

Categories : Bash

Animate Fog / Blur effect in JQuery
long time ago, but here is at least a hint for a simple solution: BlurPass.prototype.render = function(target){ $('<div/>', { html: this.content, 'class': 'foggy-pass-'+this.position }).css({ position: this.position, opacity: this.opacity, top: this.offset[0], left: this.offset[1] }).appendTo(target).fadeIn('slow'); }; just add .fadeIn('slow'); to the append-func see also: jQuery using append with effects

Categories : Javascript

Movie file Blur effect
I believe GPUImage from Brad Larson is the best way to achieve. Following is the excerpt from the github page of GPUImage //Filtering live video //To filter live video from an iOS device's camera, you can use code like the following: GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"CustomShader"]; GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, viewWidth, viewHeight)]; // Add the view somewhere so it's visible [videoCamera addTarget:customFilter]; [customFilter addTarget:fil

Categories : Iphone

How can I produce an effect similar to the iOS 7 blur view?
Actually I'd bet this would be rather simple to achieve. It probably wouldn't operate or look exactly like what Apple has going on but could be very close. First of all, you'd need to determine the CGRect of the UIView that you will be presenting. Once you've determine that you would just need to grab an image of the part of the UI so that it can be blurred. Something like this... - (UIImage*)getBlurredImage { // You will want to calculate this in code based on the view you will be presenting. CGSize size = CGSizeMake(200,200); UIGraphicsBeginImageContext(size); [view drawViewHierarchyInRect:(CGRect){CGPointZero, w, h} afterScreenUpdates:YES]; // view is the view you are grabbing the screen shot of. The view that is to be blurred. UIImage *image = UIGraphicsGetImageF

Categories : IOS

iOS 7 dynamic blur effect like in Control Center
Here are ready solutions that I've found: 1. The most unexpected: Use UIToolBar - (id) initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { [self setup]; } return self; } - (id) initWithCoder:(NSCoder *)coder { if ((self = [super initWithCoder:coder])) { [self setup]; } return self; } - (void) setup { if (iOS7OrLater) { self.opaque = NO; self.backgroundColor = [UIColor clearColor]; UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:self.bounds]; toolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; toolbar.barTintColor = self.tintColor; [self insertSubview:toolbar atIndex:0]; } } UIToolbar can be used for this ne

Categories : Iphone

Text-shadow density in css to get a blur effect
I'm not sure what exactly you're trying to achieve @PoseLab but the "blur" attribute on text shadow is supported in most browsers if you check support for this. caniuse.com by changing the blur up and down from 0 would surely change the density from a solid colour, to a more faded effect. maybe doing something like text-shadow:2px 2px 0 #fff; JS Fiddle hope this helps, you can always play around with a text-shadow generator too. CSS3 text shadow generator P.S (i apologize also, Text-shadow is supported in IE9 as well)

Categories : CSS

mouse hover, css div effect, alpha and new button
The basic idea is have wrapper for three divs. One div with the image, one div with the shadow and other for the button. The reason there are separate divs for the shadow and the button (or link) is to avoid the transparency effect on the button. I guess there are better ways to solve the problem but i would use this one because i find it easier. Demo http://jsfiddle.net/chepe263/a97FS/10/ <html> <head> <style type="text/css"> .contenedor{ position:relative; width: 200px; height: 200px; border: 1px solid black; } .atCorner{ position: absolute; top: 0; left: 0; width: 100%; heigh

Categories : CSS

Implementing picture zoom effect using Rmagick and FFmpeg
The simplest, brute-force approach you could take is to resize your starting images at the beginning of the process to be 3 or 4 times larger than they need to be at maximum zoom. That will reduce the effect of integer pixel rounding once you resize back down for the video frame, to the point where it is (hopefully) not easily visible or at least not distracting. The advantage of this approach is that you can keep most of your existing code as-is. The disadvantage is that you will need to experiment to get the right scaling factor, and depending on your source material and target video size you might end up working with some very large images. If that simple patch is not to your liking, then it is possible to work with sub-pixel sampling zooms and pans in Image Magick . . . I had a lo

Categories : Ruby

Video player for OS X (QTKit, ffmpeg)
You can easily compile ffmpeg by regular "./configure && make" and add built static libraries into your xcode project. More sophisticated approach is to create xcode projects for each ffmpeg library (libavcodec/format/util/etc) and add them as nested projects. It is posible to add external codecs to QTKit? Check Perian project: http://trac.cod3r.com/perian/browser http://perian.org/

Categories : Osx

ffmpeg + play video loop
From documentqtion lavf_decoding.html#ga4fdb3084415a82e3810de6ee60e46a61">http://ffmpeg.org/doxygen/trunk/group_lavf_decoding.html#ga4fdb3084415a82e3810de6ee60e46a61 0 if OK, < 0 on error or end of file so if <0 then call av_seek_frame to return to start (same doc)

Categories : C++

Video Trimming via ffmpeg twice crash
Your problem may be related to discussion here The linked thread is old but symptom there was that android/JNI call to ffmpeg worked first time but not the second time. As noted in the thread, the solution is to explicitly unload/load the library in between successive calls to ffmpeg. you could try it.

Categories : Android

Watermark in video with ffmpeg Center-Top
ffmpeg -i input1 -i input2 -filter_complex "overlay=main_w/2-overlay_w/2" out Use -filter_complex when you have multiple inputs and or outputs; this option also allows you to omit the movie source filter. See the overlay video filter documentation for more info.

Categories : PHP

using ffmpeg to display video on iPhone
You should not be using ffmpeg in an iOS for a number of reasons. First, there are real license issues that put including ffmpeg in a legal grey area when it comes to iOS apps. Second, performance will be very very poor. Third, iOS already includes APIs that have access to the h.264 hardware on the device. You can find my example Xcode project at AVDecodeEncode, this is an example of using my library to decode from h.264 and then encode back to h.264.

Categories : Iphone

Adding Alpha channel to bitmap or converting bitmap to 32bit
I really recommend you use a library like FreeImage. The benefit of the library, besides it being fairly lightweight and extremely open license, is the fact that it'll handle all image types easily. Then converting from any format (including different bitmap formats) to 32bit is trivial. So is rendering and other tasks. Besides that, if you'ren't interested in using a library, is just manipulate the pixel data yourself. Converting from 24bit to 32bit is fairly trivial with two points and casting. Something like this should do: uint8_t* pArgb; uint8_t* pRgb; GetDIBits(BufferDC, hImage, 0, BufferInfo.bmiHeader.biHeight, pRgb, &BufferInfo, DIB_RGB_COLORS); pArgb = (uint8_t*)malloc(4 * BufferInfo.bmiHeader.biWidth * BufferInfo.bmiHeader.biHeight); for (int i = 0; i < BufferInfo

Categories : C++

Using ffmpeg to watermark a capturing video on Android
Here is an example, how to capture a webcam video on my Windows system and draw a counting timestamp. To list all devices that can be used as input : ffmpeg -list_devices true -f dshow -i dummy To use my webcam as input and draw the timestamp (with -t 00:01:00 1 minute is recorded): ffmpeg -f dshow -i video="1.3M HD WebCam" -t 00:01:00 -vf "drawtext=fontfile=Arial.ttf: timecode='00:00:00:00': r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y output.mp4 The font-file Arial.ttf was located in the folder I was with the terminal in. (Source : http://trac.ffmpeg.org/wiki/How%20to%20capture%20a%20webcam%20input and http://trac.ffmpeg.org/wiki/FilteringGuide) I hope it may help. Have a nice day ;)

Categories : Android

can i use ffmpeg with actionscript to convert a webcam video flv into mp4?
The only option i can think of is to use Air and Nativeprocess as described here http://www.purplesquirrels.com.au/2013/02/converting-video-with-ffmpeg-and-adobe-air/ Otherwise I'm afraid this cannot be done unless someone does a port of FFMPEG to flash. The easiest way to do the video conversion you mention is to install FFMPEG on a server, send a request, and get the result back later.

Categories : Actionscript

ffmpeg Getting image or thumbnail from video error
You did not give ffmpeg a name :-) So you tried to execute a \bin folder ! $ffmpeg = "C:\Ffmpeg\ffmpeg-20130605-git-3289670-win64-static\bin"; you forget ffmpeg.exe $ffmpeg = "C:\Ffmpeg\ffmpeg-20130605-git-3289670-win64-static\bin\ffmpeg"; I do it for a .avi with following command ffmpeg -i Echo2012.avi -r 1 -s 1024x576 -f image2 -vframes 1 foo-001.jpg Don't execute your command twice ! $command = "$ffmpeg -i $video -an -ss $second -s $size -vcodec mjpeg $image"; echo $command; shell_exec($command); if(shell_exec($command)){ EDIT : your command string : ffmpeg -i upload.tmp -an -ss 12 -s 150x90 -vcodec mjpeg manu.jpg -vcodec codec (output) : Set the video output codec. It's a switch for a output video. You want as output an image. -an : You can disable Audio

Categories : PHP

Android encode video with ffmpeg while it is still recording
Your real time requirement may lead you away from ffmpeg to webrtc and or to html5. some resources; http://dev.w3.org/2011/webrtc/editor/getusermedia.html (section5) https://github.com/lukeweber/webrtc-jingle-client ondello .. they have api rather than going native and trying to get at the video stream or getting at the framebuffer to acquire an xcopy of what is in the video buffer, and to then duplicate the stream an manage a connection (socket or chunked http), you may want to look at api type alternatives....

Categories : Android

Convert Video in html5 with ffmpeg on aruba
If ffmpeg is installed then you should able to convert using ffmpeg on your server. Logon, change to the directory video1.mpg is located and run: fmpeg -i video1.mpg video.m4v

Categories : Misc

FFmpeg - C - Encoding video - Set aspect ratio
to set the output aspect ratio, you can use the `-aspect' option, see ffmpeg documentation. -aspect[:stream_specifier] aspect (output,per-stream)’ Set the video display aspect ratio specified by aspect. aspect can be a floating point number string, or a string of the form num:den, where num and den are the numerator and denominator of the aspect ratio. For example "4:3", "16:9", "1.3333", and "1.7777" are valid argument values. If used together with ‘-vcodec copy’, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists.

Categories : C

C api on capturing video stream from webcam using ffmpeg
You are basically repeating the question you are referring to. FFmpeg is basically the name of the library and the ready to use tool (command line interface). Its back end is a set of libraries: libavcodec, libavformat, swscale etc. There is no comprehensive documentation on these libraries, instead there are samples, there is mailing list and other sparse resources. Also, the libraries are open source and all these are quite usable once you get the pieces together. Specific questions on ffmpeg are asked/answered on StackOverflow as well.

Categories : C

Concat video files of different resolutions using FFmpeg
For merging videos you need to work with the same resolution, you should scale the 640x480 video or compress the 1280x720, it is up to you. I would recommend you compress the bigger one it is faster. Moreover, for merging videos you need a media file with audio and video part. You can create a silence audio with the same duration of your video and after you can add it to your video. Videos should be merged with audio. ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -i /dev/zero -ab 128K -f mp2 -acodec mp2 -y silence.mp2 ffmpeg -i video_without_audio.mpg -i silence.mp2 video_to_merge.mpg

Categories : Android

Fastest way to extract a specific frame from a video (PHP/ffmpeg/anything)
Of course you could code up some C/C++ and link to -lav*, basically creating a simplified version of ffmpeg just for extracting frames, and maybe even do it as a php extension (also I wouldn't run it as the same user, let alone in the same process). But the result is very unlikely to be faster, because you would only avoid some forking and setup overhead, but your likely problem is actually the decoding, which would still be the same. Instead, you should first look into using ffmpeg in fast seeking mode (or fast/accurate hybrid mode). Their wiki states about fast seeking: The -ss parameter needs to be specified before -i: ffmpeg -ss 00:03:00 -i Underworld.Awakening.avi -frames:v 1 out1.jpg This example will produce one image frame (out1.jpg) somewhere around the third min

Categories : PHP

how to change the frame rate for a part of video using ffmpeg
Found a software named openshot.It perfectly matched my requirements. It is built over ffmpeg. I guess this is the best video editing and mixiing tool in linux for lame users. It can help us doing things very fast.

Categories : Ubuntu

how to get width/ height of video file using S3FS, FFMPEG in ec2
I would like to recommend to take a look at the new project RioFS (Userspace S3 filesystem): https://github.com/skoobe/riofs. This project is “s3fs” alternative, the main advantages comparing to “s3fs” are: simplicity, the speed of operations and bugs-free code. Currently the project is in the “testing” state, but it's been running on several high-loaded fileservers for quite some time. We are seeking for more people to join our project and help with the testing. From our side we offer quick bugs fix and will listen to your requests to add new features. Regarding your issue, RioFS is able to read "requested" blocks of files, for example I tried to get properties of a video file stored on S3: Mounted RioFS: ./riofs -c ../riofs.conf.xml http://s3.amazonaws.com bucket_nam

Categories : Amazon

Android FFMPEG command line for video filter
Your ffmpeg build is too old to support the curves video filter with presets. Presets were added on 2013-03-25 (lavfi/curves: add presets support) bumping libavfilter to version 3.48.103. You will need to update your ffmpeg.

Categories : Android

Playing videos on iPhone after video conversion using ffmpeg
I just wrote a blog post that covers encoding_h264_for_ios that shows examples of h.264 encoding that do and do not work on iOS hardware. The specific command line that I use is this: ffmpeg -y -i INPUT.mov -c:v libx264 -pix_fmt yuv420p -preset:v slow -profile:v baseline -crf 23 OUTPUT.m4v If I were you, I would try to encode the videos on the command line and test them on iOS hardware without the web interface. Then, go step by step with specific command line options until you found the one that was breaking the iOS playback.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.