Encode/Decode CMYK Images from Flash Player - actionscript-3

I'm currently working on an image editor in Flash Player, and I need to be able to export CMYK images to my server. I'm completely new to color profiles and the like, and I was wondering how I could accomplish this. I am pretty sure all images in Flash Player are ARGB, so is there a way to convert the values properly?

You will need to read a little bit about the JPEG format - I mean, not just "JPEGs are used in XYZ, because XYZ." - I mean like the actual format down to the bytes. Because I don't really know if anybody did an actual library for that, maybe you will have to do it.
You need a library that understands the JPEG format and knows whether it is CMYK or RGB, and then to actually convert it (that includes the CMYK-RGB math).
It is not included in the flash built-in libs.

Related

Bitmapdata/bytearray to video file

I just started working with Adobe Flash CS6, and have been trying to find a way to make a game that can record parts of itself. So far I have been able to capture the desired areas of the screen as bitmapData and encode that as PNG and JPEG to byte arrays, and have made an array that I use to store them in order of occurrence. I can use file reference to save them to my computer one at a time, but I need a way to group them together as a video file of any sort. Even as a GIF would do, it may not be video but at least it moves.
Basically I have a bunch of frames collected by my game, how do I get them to someone's desktop as a video file?
If this is impossible for Flash CS6, can it be done with Flash Builder or do I need Adobe Air? I have found multiple methods that work for Air, but I don't have it myself.
You are pretty much answering your own question: you have to encode the data in the right way. Intead of encoding as PNG or JPEG, encode into the video codes that you want.

AS3 replace string/text with image characters

i am developing the code for a simple game in AS3 and i have all the graphic assets made by a designer.
He wants all the textual messages (i.e. win, lose, lives, etc.) to be done exactly as in the original photoshop drawing, they have lots of visual fx on them.
Since these messages inside the game are dynamic, I tried to use normal textfields and replicate the visual fx with Flash filters, but the result is not even comparable.
I think i could try to export from photoshop a spritesheet with the all the image characters, or the single image characters one by one, and replace my old textfields with sprites/movieclips in which i would load the specific image characters based on the string i need to show to the enduser, but i don't know precisely how to do it.
Does anyone have some hints on how to achieve this result? Better to use a separate class and image library? I googled online hoping to find some class or method alike to customize a little for my needs, but unfortunately i haven't found anything!
You could add all the graphics to the library exporting them with each name.
Than call them when needed creating a MC. If useful, you could store the names in an array and use it to simplify your script (it depends on usage)
Ok, after some more research, i found out my main problem in not finding answers to my problem was the terms of research i was using.
I was erroneously looking for "AS3 string replace with images" or "text replace with images in Flash", while the correct question was: "how to use a BITMAP FONT in AS3".
I was sure someone else had to do what i'm trying to do (like in old games where texts were all image sprites) but i didn't know how to find it!
So, this is the solution i found, i still have to refine the workflow but it's a good starting point:
Create a custom Bitmamp font using the SHOEBOX tool in conjunction with photoshop, where you will be able to apply all the raster fx you want (here's the tutorial: http://renderhjs.net/shoebox/bitmapFont.htm)
You will obtain a .fnt file (descriptor) and a .png image (font characters atlas)
You will need to flip the png image vertically: apparently, a lot of bitmap text engines work with flipped characters, and i found this one to be working like this as well
Once you have these files, use the BMFontRenderer AS3 class to embed your bitmap font into an AS3 project of your choice (tutorial here: http://blog.bengarney.com/2011/12/07/fast-bitmap-fonts-in-flash/)
I hope it will be useful for others who may need to replace standard text in Flash with font images.

More or less proper converting from RGB to CMYK

I am working on an app that saves canvas content as a raster image, then user saves it to his computer to print with a printer or print office. If you visit the link, you can click button Export and click the link to save the file. I know I can't handle CMYK with canvas and the file is sent as RGB. But I can control color values that are used for generating the image. For example, if I know that some object is any shade of black, I can put it on a separate layer and then join black layer and colored layer together on server side. May be it can help with the issue. So, I wonder if any of you faced a similar challenge to generate color-accurate image ready for print with canvas. Or may be using SVG can help me by any chance? Please share your hints.
Note: I use Python as a server-side language but I think any language library/solution will work for me if it does the job.
CMYK is always dependant on the kind of paper. E.g. the total ink for very dark color tones might be around 350% on glossy paper, but only 200% on coated paper. So you have to know the target medium in advance. There is no 1:1 conversion from RGB to CMYK.
Nowadays most printers handle RGB just fine, I wonder why you really need to do the separation at all.
If you insist on converting to CMYK, have a look at http://cue.yellowmagic.info/softwares/separate-plus/index.html for a possibility to do that with a GIMP plugin. I am quite sure that it is scriptable server-side.

Optimal configuration for Tessnet -- is image format conversion good enough?

I need to do OCR on a group of images. I have been using Tessnet and it works pretty well. The problem is that it seems to have problems with some images, so I thought that it might work better if I modify the images' brightness, contrast, etc. Also, the images are in .jpg format, but I read that .tiff is optimal.
What can I do? Should I just convert the JPEGs to TIFFs?
There's no point in converting the jpeg images to a lossless format like tiff, you will convert the artifacts as well. You could try and apply a sharpness kernel on the image before you try to do ocr on it.
Look at this page for more information.

Is it possible to generate thumbnail from a flv using as3?

Is it possible to generate multiple thumbnails from a FLV using only as3? The flv is on the same server as the swf so I'm not using any dedicated streaming server. I'd imagine that as long as the flv has load the video you'd be able to pull bitmapdata from a specific time of the flv.
My idea is to pull around 8 images from every flv, convert them to buttons and use them as links to specific chapters in the flv.
If this is not possible, would it work better with a dedicated streaming server like red5?
Edit:
I'd also like to know how to do it if it's possible :)
The idea is to not use the server.
The thumbnails will only be used within the swif, so no saving to another location.
You can do this in AS3 as long as you're actually playing the video within Flash. While playing when you seek to the desired frame capture a bitmap. If you want to save the bitmap for later use you need server-side code to store it.
Streaming vs http download will not make this problem any easier or harder (although with a streaming server you can seek to the desired point without having to download the whole flv to that point).
This would be much better done on the server. You'll need an app that can extract an image from an FLV. ffmpeg can do it.
I know it is possible to get mplayer to output stills from an FLV (though might need a bit of fiddling to get the time reference right), and these in turn can be stuffed into ImageMagick to resize into thumbnails. Not best solution, but probably easier than digging around as3's API.
video thumbnailer is a good idea.
http://blog.chrometaphore.com/2010/03/26/how-to-create-video-thumbnails-runtime-in-pure-actionscript-3-0-videothumbnailer/