Custom soundcloud player, change waveform png colour? - soundcloud

I'm creating a custom player/skin from the the soundcloud js api ( http://developers.soundcloud.com/docs/custom-player ).
All is good except I can't seem to find a way to change the colour of the waveform png (e.g. http://w1.sndcdn.com/ek9l31pY98LB_m.png )... is this even possible?
thanks
:: Ed

You can change the fill of the waveform in you CSS file, just locate
.sc-scrubber .sc-played {
background-color: #333;
opacity: 0.4;
}
and change the color to whatever you prefer.
Not sure if this is what you wanted though

You could use back-end processing (eg: for PHP, the GD or ImageMagick library) or even on the front end, use Javascript and <canvas> to recreate the waveform in whatever style you like, but as Paul said, there's no pre-packaged solution for you.

There is a JS library which will handle this for you: http://waveformjs.org/.
It uses a webservice to analyse the waveform, return the peaks and draw them for you, so it will only work with browsers that support Canvas.

Sorry, our API does not provide any mechanism for changing the waveform colour.

Yes, this is definitely possible.
As others have suggested about using a server-side script to re-colour it, I have built a solution that does the following:
use javascript to listen to the onPlayerTrackSwitch.scPlayer event emitted by soundcloud player when the track changes.
grab the URL of the waveform's img src
replace the waveform img src with a URI of a custom PHP script on your server.
The custom PHP script takes the original waveform image url as well as RGB colour values and uses the GD image library to load it and re-colour it.
The PHP script finally renders the re-coloured image with the Content-Type: image/png header.
Full Example: https://snipt.net/plong0/custom-soundcloud-waveform-png/

Related

Textarea Resize Handle Image Source

Where can I get the source image for the text area resize image in each browser?
I've got a custom control that is resizable with some standard text areas on the same form (TinyMCE). I'm trying to make the resize handle on my custom control LOOK the same as the text areas surrounding it. However because every browser uses a different image for the resize handle it looks fine in let's say chrome where it's 2 small bars but it looks goofy in firefox where the resize handles are larger and all dots.
Is there any way to ask the browser for that image specifically so my control will look the same in every browser?
After way too much research I've found there's no easy way to get the source of the image for the current browser. So I simply made a simple handle image I can use in all browsers that doesn't replicate any current browser handle.

Image manipulation tool on my website

I would like to ask if anyone knows a software that can be modified and used on my website. I need a tool that will be able to add multiple images resize and move theme. Something like THIS but with multiple images support...
Beside that I need a canvas to be fix (width, height, dpi...) So the produced image will always have the same specifications...
Thanks for your answer!
nothing beats http://www.imagemagick.org/script/index.php

How to create facebook wall posts and add retina version of picture

We're using the facebook graph API http://developers.facebook.com/docs/reference/api/post/ and adding the picture parameter. Our picture is a 30x30 pixel image, which is exactly the size we want for the facebook web version. However, the image will be pixelated when using the FB mobile app on an iPhone4 (retina display).
Is there any way to serve a 60x60 high resolution image, but render it always at 30x30 for facebook wall posts?
Well.. as of this moment, here is what I have found out, and offer a 'solution' that has worked for me based on the time i've had to test & play with this concept. For all the readers out there, who need a quick answer to the question, i don't have the exact solution to the question, but…. Essentially, your 30x30 image is being scaled to 90x90. The 60x60 image is being scaled to 90x90. And I can not find a way to go around this.
Below is what I have tried. Feel free to add input.
Take your feed image, and stroke a 2-5px black line around the frame of the image.
Load up your app, initiate a wall feed on the device. With the image present, take a screenshot. Mail yourself the image. Open it up in Photoshop (or photo editing program). Use a Marquee tool to outline the image. Cut it out of the screenshot and paste it as a new image. What size is it? 90x90, right? (and obviously 180x180 if image is retina)
Create a 90x 90 image. Copy your original 30x30 image and paste it anywhere you want within the new 90x90 images' frame. Upload it to the URL parameter's location. Re-run your app. By re-running it, i mean you have to shut it down completely, it appears as though the SDK is cacheing the image upon first launch of the feed and you can clear that cache by closing the app completely, and rerunning it. When you do, you will see significant improvements with the look of the image. It may not be a retina image, but it at least won't be 'fuzzy ugly'. At this point, it boils down to how nice of illustrative lines that where done in the design process to remove the aliasing effect produced from the conversion to a raster graphic. As well, i'm not sure if a variation of resampling method will produce even better results.
Some things i've tried:
I've also saved it as a png file with no transparency : 144ppi at 90 x 90 size. In other words, save your 90x90 image with a higher resolution (pixels per inch). Remember to not constrain proportions as you image resize. And note that If you are using adobe products, i.e. photoshop ) - don't save for web, just use 'save as…', as this will retain the ppi you specified. Although, i don't believe i see much of a difference in the quality which this is displayed going this route, and best to try to keep the file size down as this will increase the overall image size by about 500% or more.
I've tried variations of hosting the image twice the size (180x180) within the same hosted folder and naming it image#2x.png & image-large.png <--(just for the heck of it). This is not really solving the problem either.
Some other things I have not tried:
Monitoring your web server traffic, and any "not found" errors to a resource to see if FB is trying to access an a potential alternate resource when grabbing your image for display, the wall feed box that comes up is a webview. Meaning web graphics. (It's FB's web page…meaning their rules, and i doubt the pages' source is available to dabble with within the SDK.. so!…
Look at the HTML of the feed itself with safari browser:
The inspection of the HTML within the final resulting image that is posted on my FB wall I can see this….
<img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=153675474666495&v=1&size=z&cksum=773bba91f6146b2463eed0a0bb77dc42&src=http%3A%2F%2Fwww.thumbwizards.com%2Fspeakinapps%2Fgraphics%2Fboxed%2Faussie.png" alt="">
I am wondering:
Within HTML5 isn't there a mechanism to provide a toolkit type of javascript to display retina graphics from a web page?
Would it be possible to have that code run when grabbing the url to the image (in meaning, the url of the image would be acting as a pointer to the code.? I haven't tried playing with this, since my logic tells me that per the url above that FB is essentially taking control over the image at this point. I have noticed (and not waited long enough to see) that the image is apparently cached and posting to the wall with a new image, sometimes results in the older image still being used. (and yes, i've cleared my browser cache)… perhaps simply cached in another location..
If there is another parameter for the image type, that is not published, I have not stumbled across any yet.
Can anyone figure out if through source of:
[http://platform.ak.fbcdn.net/www/app_full_proxy.php] if this php file is part of an available image processor out there we can access to view what could be done?
Can anyone mention an app that uses a retina graphic in their feed post?
Just thoughts really, I've decided to not really give a crop, and if
you've made it this far. Thanks for tuning in. ..So, Sulf, your 30x30 is being scaled to 90x90. making it UGLY!.
Good luck.. If you figure anything else out, let me know!
Mark
apple specify that if you want to add the retina effect for your ios app then the images you are using in this format -i.e
sampleImag.png- 57*57(size) , 163 (DPI)
sampleImag#2x.png - 114*114(size),326 (DPI) when you use these specific graphic images you will get your app is showing retina effect in iphone 4 and above generation.
Just point your code to a larger scaled image and Facebook will take care of the rest.

Dynamic graphics rendering on the iPhone?

What I want to achieve is some way of supplying dynamically generated visual content that the user of a device could interact with - touch icons, text links, images etc embedded within some graphic image generated either on the phone or on a server. I would need, pinch, zoom, rotate functionality aswell.
Is it possible to render graphics dynamically within the iPhone's UI? So, for example, would it be feasible to supply an XML file to a device and have that render a custom map within the device? Would you have all the pinch-zoom, rotate and click on icons type functionality of a normal UI?
Alternatively, could I pre-render a png on a server and supply that to the device?
Any ideas or suggestions are appreciated.
Look into Quartz2D to help you do the custom drawing, it should do pretty much anything you want to do....
Sure, any of those are possible.
You'll probably need to write some code to interpret your XML file and generate an appropriate UIView and then embed that in the window.
And you're totally welcome to download images and display them in a UIImageView.

Transparency in PNG recognized in some apps but not others

I have a png image, which you can see here:
http://img10.imageshack.us/img10/9145/archer5.png
The background of the sprite is transparent, I see this on all my browsers and in infranview (which I used to create this), and gimp and windows explorer.
However in Photoshop, Paint, and most importantly PHP GD there is a solid background. Check out the image with one of those applications to see what I'm talking about.
The thumbnails produced on my server are all solid background, not good.
What can I do to make the transparency be recognized by all applications?
Thanks.
Note: I also have 2000 of these images that needs to undergo the same operation. Any batch suggestion would be great as well.
Edit: Sorry guys I apologize for my ineptness! WRONG FILE!
I updated the link with the correct file, sorry!
It has a transparent background in Photoshop for me. I'm guessing that if it isn't transparent in some application, it is a problem with the application (not supporting transparency) than with the file.
It's transparent for me too.
MS Paint doesn't support transparency
As you mention PHP GD check this links
Preserve PNG image transparency
Resize and Compose Transparent PNG with PHP
imagecolortransparent PHP Manual
imagealphablending PHP Manual
imagesavealpha PHP Manual
GD requires one of various options (either directly or in the image type when you create a new image) in order to output transparent pixels.
I think your problem is the applications themselves. When you say PHP GD I think what you really mean is "Internet Explorer" (since PHP is not a viewer). Internet Explorer (at least up to IE7) doesn't do transparent PNG (it puts a grey image behind) unless you do some quirky bullshit with an Alpha filter.
This is your (updated) image in safari (which supports PNG correctly):
(source: arc.net.au)
Perhaps you could try saving them as 24-bit PNGs, instead of 32-bit. Maybe PHP GD would have better support for that.