Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client-side image processing

We're building a web-based application that requires heavy image processing. We'd like this processing load to be on the client as much as possible and we'd like to support as much platforms (even mobiles) as much as possible.

Yeah, I know, wishful thinking

Here's the info:

  1. Image processing is rasterization from some data. Think like creating a PNG image from a PDF file.

  2. We don't have a lot of server power. So client-side processing is a bit of a must.

So, we're considering:

  1. Flash - most widespread, but from what i read has lackluster development tools. (and no iPhone/iPad support for now).

  2. Silverlight - allows us to use .NET CLR, so a big ++ (a lot of code is in .NET). But is not supported for most mobiles ( rumored android support in the future)

  3. HTML5 + Javascript - probably the most "portable" option. The problem is having to rewrite all that image processing code in Javascript.

Any thoughts or architectures that might help? Clarification: I don't need further ideas on what libraries are available for Silverlight and Javascript. My dilemma is

  • choosing Silverlight means no support for most mobiles
  • choosing Flash means we have to redevelop most of our code AND no iPhone/iPad support
  • HTML5 + Javascript we have to redevelop most of our code and not fully supported yet in all browsers
  • choosing two (Silverlight + Flash) will be too costly

Any out-of-the-box or bright ideas / alternatives I might be missing?

like image 313
moogs Avatar asked Feb 01 '10 03:02

moogs


People also ask

What is client-side processing?

Client side processing means that the web page gets the client - your computer - to do the validation and other processing itself, rather than the server. There are several common languages for this kind of processing code.

What is the difference between client-side and server-side?

Client-side means that the processing takes place on the user's computer. It requires browsers to run the scripts on the client machine without involving any processing on the server. Server-side means that the processing takes place on a web server.

What is the purpose of client-side?

Client-side scripting is source code that is executed on the client's browser instead of the web-server, and allows for the creation of faster and more responsive web applications.


3 Answers

This is the sort of issue that software architects run up against all the time. As per usual, there is no ideal solution. You need to select which compromise is most acceptable to your business.

To summarise your problem, most of your image processing software is written in .NET. You'd like to run it client-side on mobile devices, but there is limited .NET penetration on mobiles. The alternatives with higher penetration (eg. Flash) would require you to re-write your code, which you can't afford to do. In addition, these alternatives are not supported on the iPhone/iPad.

What you ideally want is a way to run all your .NET code on most existing platforms, including iPhone/iPad. I can say with some confidence that no such solution currently exists - there is no "silver bullet" answer that you have overlooked.

So what will you need to compromise on? It seems to me that even if you redevelop in flash, you are still going to miss out on a major market (iPhone). And redeveloping software is extremely costly anyway.

Here is the best solution to your problem - you need to compromise on your "client side execution" constraint. If you execute server side, you get to keep your existing code, and also get to deploy to just about every mobile client, including the iPhone.

You said your server power is limited, but server processing power is cheap when compared to software development costs. Indeed, it is not all that expensive to outsource your server component and just pay for what you use. It's most likely that your application will only have low penetration to start off with. As the business grows, you will be able to afford to upgrade your server capacity.

I believe this is the best solution to your problem.

like image 144
Craig Schwarze Avatar answered Oct 13 '22 00:10

Craig Schwarze


Host you image processing on Amazon E2C, Azure, or Google. IIRC E2C has many common image processing problems packaged and all ready to go.

Azure probably more familiar ground in term of sharing code as a web service

You just pay for CPU cycles and transfers/storage etc

like image 44
user73993 Avatar answered Oct 13 '22 01:10

user73993


I'm sure there will be Silverlight and JS people posting examples. Here are some image editors written in actionscript:

  1. Phoenix
  2. PhotoshopExpress

There is an ImageProcessing library to start with. Plus PixelBender is available in Flash Player 10, it's fast, it runs in a separate thread and people do some pretty mad things with it.

HTH

like image 20
George Profenza Avatar answered Oct 13 '22 01:10

George Profenza