Transform GeoTiff into JPEG under condition of number of bands - tiff

I'm super new to FME.
I have lots of GEOTIFFs which I want to convert to JPEG, which works fine (as seen in the picture below (without the Tester)). But now some of my tiffs have 3 colour and some have 4 colour bands. If the tiff has 4 bands, I can easly remove it. But if it now contains only 3 colour bands it won't run. Therefore I tried including something of a "if more than 3 colour bands then remove them, but if 3 or less then just transform them."
TIFF-Transformer to JPEG
How do I insert this conditional selection?

a reddit user (u/jontyg83) answered my question with the following:
Try using a rasterbandpropertextractor and a listelementcounter. That should give you the number of bands you can then separate the 3 and 4 band rasters with a tester or testfilter

Related

Is it possible to grab the 4 numbers from this image using IronOCR?

So me and my friends play a game and they recently changed there images from white background and black letters to black background and colorful letters. and the old ocr that we was created years ago by someone is pretty useless now as the accuracy is very low if not 0% (it just took the old ocr ~250 attempts). So my question would i be able to to extract the text from the following picture
I have never used IronOCR and i tried using the default code to get text from image but the results were weird.
Thanks in advance!
You can try to segment the image first by color (a histogram analysis will tell you colors on the image). Then you can convert the images to b/w and run OCR. You'll get better accuracy.

A basic query about Generative adversarial Models

Is it possible for the Generator to learn a distribution when noise is a specific input say n images instead of a random noise? For example, there are two categories of images with labels 0 and 1 say 0 for cats and 1 for dogs. Is it possible to learn the generator as we feed it a dog and it will generate a cat image against that dog image?
This query is somehow the same as deblurring images but what if no clear image is given against that blurred image but we are just given with random clear images.
Sure, it is possible. This is called style transfer and there have been a lot of works on that. In a way you learn a mapping function between the manifolds of dogs to the manifolds of cats. A famous work in that direction is the CycleGAN paper (https://arxiv.org/pdf/1703.10593.pdf), which uses a cycle consistent loss to map from one direction to the other and back. This makes the training more stable and the resulting images closer to the initial images.

Actionscript 3 Dynamic line drawing with changing alpha

I have been creating a training tool for a customer in Flash, using Actionscript 3. In it i have to create one continuous line generated over time, whose alpha is controlled by a static object and its distance from a continuous moving object. The closer the two are, the stronger the line, the further the weaker. This alpha only effects the the line at the current time, leaving the historical alpha as it was when the the line was produced. The way I have currently made it is by generating lots of small lines, which when joined together make one big line. Thus each small line has a different alpha. The overall effect is to create fade ins and outs based on the distance between the two objects with historical alpha still showing. Does anyone out there have a better way of achieving this effect? Hopefully, I have not just confused everybody.

How to deal with TIFF files with incompatible ICC color profiles

I'm writing a TIFFImageReader plugin for Java (ImageIO), but the question is generic:
What is the "correct" way to deal with a TIFF file that contains an ICC color profile that does not match the image data (ie. image data is RGB, but TIFF metadata contains a CMYK ICC profile)?
I recently had a user report this problem. The quick and easy fix is to just issue a warning, and ignore the color profile. However, the TIFF 6.0 specification doesn't mention ICC profiles at all, or how to deal with them. ICC Specification ICC.1:2010-12, annex B does describe how to correctly embed color profiles, but does not mention profile relation to image data (other than being in the same IFD).
There is no "correct" way to deal with this as a general problem.
The color profile tells you how to connect RGB numbers, which by themselves are just abstract values, to a device-independent space like CIE XYZ or CIELAB so you can correctly interpret them as colors and display them in a consistent way.
With an incorrect profile (or without a profile for that matter) you can't know how to interpret the RGB numbers. It's a little like getting a weight measurement without units of with incorrect units. If I have a recipe that calls for 5 units of water, and you don't know whether that should be 5 grams or 5 cups, you are kind of stuck. You can either guess or tell the user their information doesn't make sense.
In many cases you can make an educated guess based on domain-specific information. For example, we can often correctly guess that images on the web without a profile will likely be sRGB data, but that's just a guess. A lot like assuming a recipe for cookies that calls for 1 flour probably means 1 cup of flour.
It's very unusual for an RGB image to carry a CMYK profile — it's really hard to understand how that even happens. If I had to deal with this, I would throw an error with a message about the problem. If color accuracy is not critical, you could also strip the profile and let whatever downstream process needs to display the image deal with the untagged image, or guess something reasonable like sRGB with the understanding that it is just a guess.

How to merge multiple images (.GIF) in one with ASP?

I have a map of Europe, and what I want to do is have each country of a colour depending of some variables. I display them correctly as separate .gif's, but I'd like to create a unique gif so it can be downloaded as 1 image.
Is it possible to do with ASP?
Thank you very much :)
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8626&lngWId=4
I wrote that back in 2003, it'll do what you're asking with some tweaks, but I haven't touched ASP in at least 5 years :)
The idea is that the script opens a gif, reads out the color palette and re-writes it. It's currently configured to "adjust" the palette's HSL so that you can get different colored images (e.g. you could adjust a green image to blue or red), but you could just as easily selectively replace individual colors with whatever you want.
The idea then would that you would make each country it's own specific color and then replace that color with whatever you wanted later. As long as there are <= 256 total colors, you should be fine.
If you want something more complicated, try looking into imagemagick
There is nothing within ASP to do what you want. You would need some third party component to perform this type of task.