Tuesday 19 September 2017

Fx Opzioni Cross Gamma


Cassette IO Utilities Utilità per gestire nastro e immagini del disco floppy da computer da tasca d'epoca Si tratta di software libero, rilasciato sotto la GNU General Public License. Il software è fornito così com'è. Im non affidabile per eventuali conseguenze derivanti dall'uso di esso. Tutti i nomi di marchi, società o di prodotti appartengono ai rispettivi proprietari Le utilità qui erano originariamente destinati solo per computer tascabili Casio. Ive ha recentemente iniziato a supportare altre macchine con un formato di dati comparabili e sono pertanto rinominato il pacchetto da Casio utilità per cassette IO Utilities. L'obiettivo principale è ancora sulle macchine Casio e la maggior parte della documentazione gestisce solo loro. Si tratta di lavori in corso Non tutte le funzioni funzionano su tutti i sistemi operativi e alcuni file possono essere trattati male male. Ci scusiamo per eventuali disagi. Aggiunta l'opzione - d per list850 al fine di supportare i file copiati da un disco MD100. Rework di MD100. Rimosso l'opzione - f e ha aggiunto opzione - p seguenti informazioni da Piotr Piatek. Corretto un bug che causa un ciclo infinito quando si scrivono file wave stile tagliente. Colpisce soprattutto wav2wav. supporto per i file di dati necessari alcuni miglioramenti. possibilità di sopprimere l'uscita intestazione list850 Aggiunto. Aggiunto il supporto per i file di dati a bas850. Aggiunto Unicode (UTF-8) sostegno alla list850, listX07, bas850 e basX07. Opzione - i ignora i dati con errori di framing o di parità sull'ingresso file wave per la maggior parte della lista utilità. binari aggiunto per host Windows CE (ARM, CE 3.0) Rimosso il supporto PPC per OSX (non ho più un compilatore appropriato) list8000 ora supporta la visualizzazione e l'esportazione di gamma ViewWindow dati list8000 ora esporta memoria variabile file di CAS (per FA-121) . bas850 e MD100 consentire tubazioni su file di testo. Corretti alcuni sequenze di escape (phi-gttheta). list8000 ora supporta l'esportazione in formato FA-123FA-124. list8000 - Aggiunto il supporto per la messa in vendita di fx-8000G calcolatrice grafica con interfaccia FA-80. wav2wav migliorato per supportare più formati. list74 - Supporto per la TI-74 ha inizio. waveX07 - Aggiunto il generatore di file wave per Canon X-07. basX07 - Aggiunto tokenizer per Canon X-07. listX07 - Primo programma per una macchina non Casio: Canon X-07. Il seguente software viene fornito: list702 - Mostra il contenuto di un file binario o WAV come testo base o dati. Questo programma è per l'FX-702P. È un adattamento di list730. list730 - Mostra il contenuto di un file binario o WAV come testo base o dati. Questo programma è per la serie PB-100. E 'stato originariamente creato da Piotr Piatek. Ive ha aggiunto i vari formati di file. list850 - Mostra il contenuto di un file binario o WAV come testo base o dati. Questo programma è per tutte le macchine più recenti, a partire dalla PB-700 e incluso il FX-850 e PB-1000. La FP-200 è incluso pure. list8000 - Mostra il contenuto di un file binario o WAV come elenco fonte, registri, immagine sullo schermo o il testo. Questo programma è per la serie fx-8000G di calcolatrici grafiche. list8000 può esportare in un formato di file compreso da Casios FA-121 o il software FA-124. listX07 - Mostra il contenuto di un file binario o WAV come testo di base. Questo programma è per la Canon X-07. list74 - Mostra il contenuto di un file binario o WAV come testo di base. Questo programma è per la Texas Instruments TI-74. wave730 - Creare un file WAV da un file binario. Questo programma è per la serie PB-100. wave850 - Creare un file WAV da un file binario. Questo programma è per tutte le macchine più recenti, a partire dalla PB-700 e incluso il FX-850 e PB-1000. La FP-200 è incluso pure. I file possono essere creati in (S) a basso modalità AST o (F). waveX07 - Creare un file WAV da un file binario. Questo programma è per la Canon X-07. bas702 - Creare un WAV (o binario o ASCII codificati) file da un testo di partenza BASIC. Questo programma è solo per il FX-702P. bas730 - Creare un WAV (o binario o ASCII codificati) file da un testo di partenza BASIC. Questo programma è per tutte le macchine più vecchie, a partire dalla PB-100 o FX-700P e incluso il FX-730P e FX-795P. bas850 - Creare un WAV (o binario o ASCII codificati) file da un testo di partenza BASIC. Questo programma è per tutte le macchine più recenti, a partire dalla PB-700 e incluso il FX-850 e PB-1000. La FP-200 è incluso pure. I file WAV possono essere creati in (S) a basso modalità AST o (F). I possibili formati di dati sono di testo (per essere caricato con LOAD, A su alcune macchine) o formato interno (per essere caricato con carico). basX07 - Creazione di un WAV (o binario) file da testo sorgente BASIC. Questo programma è per la Canon X-07. wav2raw - Estrarre un'immagine binaria da un file WAV. Funziona per tutti i modelli. wav2wav - ricreare un po 'di file WAV per bit. Il file risultante può essere meglio compresso da un software di compressione senza perdita di dati, come ZIP o GZIP che una registrazione originale. Dal momento che la ricreazione è fatto bit per bit, il programma dovrebbe funzionare per qualsiasi file WAV, registrata nei Kansas City standard con 2400 Hz carrier. (Ive ha recentemente incluso il supporto per i computer Sharp che utilizzano diverse frequenze.) MD100 - gestire le immagini di MD-100 floppy disk scritti dal PB-1000 o computer PB-2000C. Su alcuni sistemi PC funziona anche sui dischi reali Generazioni di tasche Casio. I computer tascabili Casio base possono essere raggruppati. All'interno di ciascun gruppo, i file di programma possono essere scambiati o programmi possono essere trasferiti direttamente da una macchina all'altra attraverso le loro interfacce nastro. Non tutti i programmi possono essere eseguiti su tutte le macchine all'interno della stessa serie, perché alcune parole chiave diverse. L'FX-700P per esempio non capisce REM. Maggiori informazioni su diverse versioni base sono disponibili nel mio foglio di confronto di base. La serie PB-100 Questo è il nome Casio ha dato a una serie di suoi computer tascabili primi con Basic. Il gruppo comprende, secondo un manuale in seguito Casio, le seguenti macchine: PB-100, PB-110, PB-220, PB-240, PB-300, PB-410, FX-700P, FX-720P, FX-730P , FX-770P, FX-785P, FX-790P e FX-795P. Possiedo alcuni di loro: PB-220, PB-300, FX-700P, FX-720P, FX-730P e FX-795P. Tutti i modelli condividono alcune caratteristiche comuni: Una modalità di interruttori a chiave tra modalità WRT (programma) RUN o, seleziona modalità angolo e reindirizza output alla stampante opzionale (o built-in). 10 aree di programma separati sono disponibili. La tastiera ha un unico tasto EXE. funzioni spostate vengono selezionate con i tasti prefisso che deve essere premuto e rilasciato prima del tasto spostato. La codifica interna non è ASCII, ma qualcosa di molto speciale. Se siete interessati ai dettagli tecnici, vedere le pagine Piotr Piateks su Internet. Tutte le registrazioni sono state fatte attraverso l'interfaccia FA-3, anche se il PB-220 ha bisogno di un adattatore per collegare meccanicamente. La velocità di trasmissione è di 300 bit al secondo. L'FX-702P Questa macchina si distingue per se stessa. Il suo dialetto BASIC è un po 'strano. I comandi GOSUB. RITORNO. STAMPA e INPUT sono stati sostituiti da GSB. RET. PRT e INP. Il codice di carattere interno è qualcosa di speciale. Non è né ASCII né compatibile con la codifica serie PB-100. La tastiera ha un tasto di modalità che funziona praticamente come sulle macchine della serie PB-100. Dieci aree di programma separati sono disponibili. La tastiera ha un unico tasto EXE. La tastiera alfanumerica è neanche organizzato come una macchina da scrivere, ma in ordine alfabetico. I due tasti shift (F1, F2) sono le chiavi prefisso. Il formato del nastro ha alcune analogie con il formato di serie PB-100, ma sembra essere una variante precedente. Il programma per elencare un file su nastro è quindi un eseguibile separato, mentre il generatore di file wave per la serie PB-100 (wave730) in grado di creare immagini per il FX-702P. Tutte le registrazioni sono state fatte attraverso l'interfaccia FA-2. La velocità di trasmissione è di 300 bit al secondo. Il PB-700, PB-770 e FX-750P Questa è una generazione più recente di sacche di base che non hanno il tasto MODE. Al contrario, il tasto INVIO sul tastierino numerico viene utilizzato per i calcoli modalità diretta, mentre la chiave di ritorno è per i comandi in entrata e linee di programma BASIC. Il tasto Shift deve essere premuto e tenuto premuto insieme al tasto in questione, proprio come su una macchina da scrivere. Dieci aree di programma separati sono disponibili. Una parola chiave speciale (PROG) passa da zone senza avviare il programma. C'è una sottile differenza nella gestione delle funzioni logaritmo. I sistemi PB (serie PB-700 e la PB-1000, vedi sotto) utilizzano LGT per il logaritmo in base 10 e LOG per il logaritmo naturale. Tutte le altre macchine, tra cui il vecchio PB-100 della serie, L'inizio e LN, rispettivamente. La codifica interna è ASCII con caratteri grafici nel set esteso. Se siete interessati ai dettagli tecnici, vedere le pagine Piotr Piateks su Internet. L'FX-750P ha un vezzo fastidioso: Non capisce i caratteri minuscoli ma visualizza niente, invece. Ciò rende impossibile la modifica linee con stringhe minuscole trasmessi da un PB-700 o caricati da un file PB-700. Possiedo il PB-700 e PB-770 con l'interfaccia FA-10 e FX-750P con l'FA-20. Ive ha testato i miei programmi con queste macchine e interfacce. La velocità di trasmissione è di 300 bit al secondo. Gli FX-850P, FX-870P, FX-880P, FX-890P, VX-1 a 4, Z-1 e PB-1000 Queste macchine hanno una nuova implementazione del BASIC, chiamato JIS standard di base da Casio. Il PB-1000 dispone di un sistema di file RAM, mentre i sistemi di FX e VX mantengono le dieci aree del programma delle macchine precedenti. La codifica interna è ASCII, ma le parole chiave di base e numeri di riga sono codificati in modo diverso (numeri di riga possono ora raggiungere fino a 65535, non solo 9999.) I set di caratteri estesi differiscono tra il PB-1000 e le altre macchine della serie. Le azioni della PB-1000 il carattere PB-700 impostato con una grafica speciale, mentre la FX, sistemi z VX e mostrare simboli matematici e scientifici, invece. La Z-1 e il suo fratello FX-890P manca l'interfaccia a nastro. Tutte le macchine tranne il PB-1000 si collegano all'interfaccia FA-6. Questa interfaccia offre una velocità di trasmissione maggiore di 1200 bit al secondo. Il formato di blocco di dati è una variante dello schema PB-700 ma la codifica dei programmi di base è diverso. E 'possibile caricare un file salvato con SAVE, A su un PB-700 nel FX-850P, e viceversa è possibile, anche. È necessario limitare la velocità a 300 bit al secondo (SAVE (S) e carico (S) sul FX-850P.) Ho potuto solo in parte testare l'interfaccia nastro con il VX-1 o FX-870P perché ho potuto scrivere solo ma non leggere i programmi o dati attraverso l'interfaccia FA-6 con queste macchine. I sistemi di FX-850PFX-880P in grado di leggere i nastri della serie PB-100 con comandi speciali (PBLOAD. PBGET). Il PB-1000 ha un connettore simile ma differenze meccaniche ed elettriche inibire l'uso del FA-6. Il PB-1000 utilizza l'interfaccia FA-7, che offre una velocità di trasferimento ancora più elevate (fino a 2400 bit al secondo, selezionabile tramite DIP switch sull'interfaccia.) La Z-1 e FX-890P non supportano più i nastri, ma può ancora essere utilizzato con il testo di traduttore bas850 e un'interfaccia seriale o USB. La FP-200 Questa è una macchina di dimensioni A4 in una classe a sé stante. La base è simile alla PB-1000, ma contiene alcune funzionalità Microsoft-BASIC anche. Il foglio di calcolo CETL incluso è unico. Il formato di nastro è abbastanza simile al FX-850P come macchine da includere la movimentazione negli stessi programmi. Nella maggior parte dei casi, l'interruttore -2 gestirà le differenze. Alcuni file ASCII codificati sono compatibili tra le famiglie, in particolare: la velocità del nastro è di 300 baud (formato lento solo). La codifica interna è diversa, i file binari non possono essere cambiati. Il formato ASCII FP-200S è capito dalla FX-850P, ma non la PB-1000. Non ho potuto testare con il VX-4 o FX-870P (vedi sopra). La FP-200 comprende il formato ASCII di tutte le altre macchine, data la velocità corretta. È possibile alimentare i file attraverso list850 e bas850 per creare i file per le diverse piattaforme. L'unità MD-100 floppy con il PB-1000 e PB-2000C calcolatrici L'MD-100 manca una interfaccia a nastro ma che importa quando un floppy disk con un vero e proprio file system è prontamente disponibile Ho due calcolatrici tascabili che si connettono alla MD-100 : il computer BASIC PB-1000 e la PB-2000C che può essere programmato in una variante di C (interpretato, piuttosto lento). L'MD100 programma comprende il formato del disco. Vi è una ROM BASIC OM-53B disponibile per il PB-2000C, che lo trasforma in sostanza in un PB-1000 con un caso diverso, ma io havent ancora visto questo. Piotr Piatek ha emulatori per tutti questi. Altre macchine Casio FX-8000G Questo non è un computer tascabile di base, ma una calcolatrice grafica. Con la sua interfaccia FA-80, è possibile salvare i programmi, i registri, grafici e file di testo a cassetta. list8000 supporta elenco di questi file. Io non sono una interfaccia me, quindi lo sviluppo è lento. I file possono conatain più di un tipo di dati. Il programma elenca i contenuti così come appare nel file. Graphics vengono convertiti in file BMP su richiesta. La registrazione viene effettuata a 2400 baud. Potrebbe essere necessario impostare il software audio ad una frequenza di campionamento adeguata per la lettura affidabile dei file WAV. Canon X-07 La Canon X-07 è una piccola macchina capace con un potente BASIC e dotato di un interfaccia di cassetta. Ive ha appena iniziato a sostenerla con i programmi listX07. waveX07 e basX07. I encordings sono in modalità veloce a 1200 baud, un formato già supportato dalla libreria onda in questo progetto. Proprio la codifica di basso livello è un po 'diverso: 8 bit, nessuna parità, almeno 2 bit di stop. Ho dovuto modificare il modello d'onda generato per rendere il lavoro Cload affidabile. Texas Instruments TI-74 La TI-74 è il successore del CC-40 di base del computer che non è riuscito in commercio, in quanto, inizialmente, nessun dispositivo di archiviazione di massa era disponibile. La nuova TI-74 può essere equipaggiato con l'interfaccia cassette CI-7, mediante il connettore DockBus. La logica dell'interfaccia è incorporato nel computer, non l'interfaccia. Questo rende impossibile l'utilizzo del CI-7 attraverso un adattatore con il CC-40. Il CC-40, da cui esistono solo pochissimi prototipi, è dotato di un interfaccia cassetta e può funzionare con i miei programmi di utilità, ma non posso provare io stesso. Il BASIC è uno dei migliori che si possono trovare per qualsiasi computer tascabile della sua epoca. Supporta sofisticati IO, sottoprogrammi con parametri, nomi di variabili lunghi, e altro ancora. I mimiks interfaccia cassetta della DockBus (o HexBus) dispositivo 1 .. E 'in grado di registrare programmi BASIC con SAVE1.NAME che vengono caricati da OLD1.NAME o semplicemente Old1 .. L'interfaccia supporta i file di dati in modalità di testo sequenziale per ingresso e uscita programmatica, nonché . Si può anche LIST1.NAME un programma in ASCII, ma non è possibile caricare nuovamente dentro il computer. Im lavorando su una soluzione, ma che potrebbe richiedere un certo tempo. Il formato di file wave è una variante piuttosto speciale della Kansas City standard (KCS) utilizzato altrove: Le frequenze sono 1.400 Hz e 700 Hz e la velocità è di 1400 bit al secondo. Ciò significa che solo la metà di un'onda viene utilizzato per un bit zero sincronizzazione 700 Hz è completamente diverso da KCS ei byte sono codificati senza avviamento, parità o bit di stop. Le informazioni vengono trasferite in blocchi di un massimo di 64 byte di dati utili. record logici possono essere composti da più blocchi. Ogni blocco è protetto da un semplice checksum e viene trasmesso due volte per la ridondanza. Salvataggio di un programma BASIC è relativamente veloce, perché è trasmessa come un grande record logico. C'è ancora abbastanza in alto di sincronizzazione per creare un secondo file di 30 onde per un breve programma, ma un programma più lungo non farà il file troppo lungo. Scrivere un file ASCII è una questione completamente diversa: si aggiunge l'overhead per ogni record del file. I proprietari di l'interfaccia PC hanno più opzioni: Si può salvare direttamente e caricare da un file system del PC. I file di programma sono binari e in genere hanno una estensione di PGM. Il programma TIC74 DOS che viene fornito con il software di interfaccia produce un file da un file di testo di base. Il contenuto di questo file è la stessa come la grande singolo record trasmessa attraverso l'interfaccia cassetta. pianificazione Im per prendere un tale file PGM come input e creare un file wave per caricarla senza l'interfaccia PC. Essere list74 paziente è già in grado di visualizzare un file come un elenco di base o estrarlo da una registrazione. Come gestire registrazioni collegare l'interfaccia a nastro con il cavo del microfono direttamente alla scheda audio. Avviare il software del registratore audio a scelta con i seguenti parametri: formato di file WAV. 8 bit per campione. Più bit sono possibili, ma non necessario. Dont uso galleggiante formato punto 11025 o 22050 campioni al secondo (E 'una buona idea, ma non è obbligatorio, per registrare 2400 registrazioni baud a 44100 campioni al secondo.) Monofonico. Registrazione livello sufficientemente elevato per riempire la gamma dinamica del file wave. In alternativa, utilizzare un editor audio come Audacity per amplificare il segnale. Invia il programma o di dati dal computer tascabile con SAVE. SALVA TUTTO. PUT o WRITE e avviare la registrazione. Fermare la registrazione quando Ready rendimenti prompt. Le registrazioni ad alta velocità (1200 baud o più) rendono difficile per i programmi di utilità per interpretare i modelli di onda correttamente perché la ridondanza è notevolmente ridotto. In caso di problemi, provare a impostare la variabile d'ambiente WAVEPHASE 1 o invertire la registrazione con un editor audio e riprovare. C'è un problema con il mio iMac e la sua scheda audio interna. Il livello di registrazione sull'ingresso line-in è molto bassa. Ive ha collegato un Soundblaster USB con un ingresso microfonico, invece. Una spina suono noname USB molto più conveniente con ingresso per microfono ha dimostrato di funzionare bene, anche. La riproduzione tramite la scheda audio interna va bene. Collegare l'ingresso EAR dell'interfaccia del nastro all'uscita PHONES della scheda audio. Vi è un problema da risolvere: sarà necessario un adattatore per collegare l'uscita stereo della scheda audio (un solo canale) per l'ingresso mono dell'interfaccia nastro. Si può danneggiare la scheda audio con il cavo fornito dall'interfaccia del nastro perché pantaloncini uno dei canali di uscita Leggi paragrafo precedente di nuovo prima di procedere Se tutto è collegato correttamente, inserire il galleggiamento corrispondente (ALL), comandi di lettura o GET e poi avviare la riproduzione del file WAV. Impostare il livello di uscita superiore al normale. Se è troppo forte per le vostre orecchie la sua appena a destra per il vostro piccolo computer Se il computer tascabile legge ed elabora i dati all'interno di un programma, avvalendosi della spina di telecomando dell'interfaccia nastro per interrompere la riproduzione, mentre si sta lavorando, si dovrà mimare questo per arrestare e riprendere la riproduzione manualmente. I file di programma non sono un problema in questo senso. Rinfrescante Le registrazioni originali (o registrazioni da altre fonti su Internet) potrebbe non essere ottimale per l'archiviazione. Lossless programmi di compressione come ZIP o GZIP non piace segnali analogici Alcune registrazioni trovate altrove non dire l'interfaccia a nastro correttamente quando la registrazione è finita. Questo può anche portare a righe di programma mancanti durante il download alla calcolatrice tascabile. wav2wav fa una copia bit-per-bit di un file WAV, registrata nei Kansas City standard o una delle varianti supportate. Tutti i modelli Casio utilizzano questo schema di registrazione, anche in modalità velocità o alta (1200 o 2400 bit al secondo), dove un po 'è rappresentato da solo uno o due onde, invece di 4-8 in modalità standard a 300 bit al secondo. Il software è in grado di ricodificare una registrazione in qualsiasi velocità 300, 1200 o 2400 bit al secondo in nessuna altra di queste velocità. Ci sono due modalità speciali per altri dispositivi: 500 bit al secondo per PDA Sharp e 1400 bit per secondo per la TI-74 o TI-95. Questi vengono sempre utilizzati per l'ingresso e l'uscita. Esso non ha senso cambiare la velocità per queste registrazioni, perché i file risultanti sarebbero inutili. Il modello di uscita è una sinusoide per tutte le velocità eccetto per la TI in cui viene utilizzato un'onda quadra. Questo potrebbe cambiare in futuro. Il programma si chiama come segue: (. E G un file da un PB-700). Se si desidera ricodificare un file di 300 baud in un file ad alta velocità per il PB-1000, utilizzare l'opzione oh solo. velocità di ingresso è di 300 per impostazione predefinita. Se si desidera ricodificare un file ad alta velocità da un PB-1000 per il caricamento in un FX-850P, utilizzare entrambe le opzioni - ih e - Di. Le opzioni sono analizzati da sinistra a destra. Così, anche la combinazione - t opere - Di, ma è inutile. È possibile utilizzare - f su 300 file baud. Questo è possibile poiché le frequenze sono le stesse. Il numero riportato di bit sarà errato di un fattore di quattro e l'affidabilità della conversione è notevolmente ridotto. Se il file convertito non può essere letto dal dispositivo, provare di nuovo con la variabile d'ambiente WAVEPHASE1. Se il file viene registrato ad un volume molto basso, provare a impostare la variabile d'ambiente WAVETHRESHOLD a valori superiori a 10. In ogni caso è meglio per caricare il file in un editor audio e normalizzare lì. La conversione in altri formati Le registrazioni possono essere analizzati (e archiviato) facilmente convertendoli in un formato binario. Diversi formati sono disponibili: Byte formato binario è solo la pianura decodificato dati. Si perde il cosiddetto lead-in sequenze utilizzate per sincronizzare il decoder e per separare blocchi di dati. Byte con errori di inquadratura o di parità sono lasciati fuori. Il formato è più facile da comprendere per gli esseri umani ed è la base per i programmi di quotazione. Word formato binario è una variante del formato binario che conserva più informazioni del flusso di dati originale. Lead-in sequenze sono codificati come un valore speciale, tutte le informazioni inquadratura e la parità è conservata nel byte superiore di ogni parola di dati. Parola formato RAW sono solo i 12 bit per byte di dati (con avviare, arrestare e bit di parità) cresce a parole di 16 bit. ASCII codificati dati grezzi è il formato generato e accettato da interfaccia seriale Piotrs. wav2raw converte un file WAV in uno dei formati di cui sopra: Aggiunta una - per la fine delle opzioni - s. - f o - h ha lo stesso effetto come impostare la variabile d'ambiente WAVEPHASE a 1. Questo può aiutare ad evitare errori di lettura a causa di una fase di sbagliato nel file wave. Utilizzare le opzioni - f - pN2 per leggere il formato Canon X-07. Le calcolatrici grafiche CASIO FX-8000G e 8500G-fx con interfaccia FA-80 formato uso - h. I miei test ha dato i migliori risultati con l'opzione - h-. Listing come testo Questi programmi interpretare un WAV o un file binario e l'uscita del suo contenuto come un programma o elenco di dati. I programmi sono list702. list730 e list850. Tutti i programmi scrivono il loro output alla console che può essere reindirizzato a un file. Casio BASIC computer list702 gestisce solo l'FX-702P. I file di dati non sono supportati. list730 gestisce la serie PB-100, vale a dire l'FX-730P. I file di dati non sono supportati. Utilizzare l'opzione - e. se si desidera tradurre l'uscita più tardi con bas730 list850 conoscenza di tutte le altre calcolatrici Casio BASIC che iniziano con il PB-700, vale a dire l'FX-850P. I file di dati e file ASCII salvati con SAVE, A sono supportati, anche. Utilizzare le opzioni - EP (o - up) e - LP quando messa in vendita di un programma PB-1000. -2 Gestisce tutte le FP-200 specifiche, in particolare la diversa codifica binaria. Casio calcolatrici grafiche list8000 liste e converte i file dalla calcolatrice grafica fx-8000G. Sono supportati tutti i tipi di record. Il comando Salva Nome A permette di risparmiare una miscela di tutti i formati disponibili: programmi, variabili (memoria), grafica e file. list8000 supporta le sequenze di escape nelle stringhe come gli altri programmi e ha ereditato le opzioni di tabella di codici listX07. Le sequenze di escape sono compatibili con il formato di file CAT (vedi sotto). Graphics vengono convertiti in file BMP se l'opzione - g è presente. Deve essere seguito da un nome di file che termina in bmp e deve contenere un carattere che è sostituito da 1 a 3. Il primo file è la risoluzione dello schermo esatto di 96 da 64 pixel. Il secondo file ha una risoluzione di 192 per 128 pixel. Viene utilizzato dal calcolatore internamente per la stampa ad alta risoluzione. Se il selettore a sinistra è impostato su N invece di HD mentre si disegna un grafico, solo ogni secondo punto è disegnato l'immagine ad alta risoluzione in. Entrambi i formati sono parte del record grafico sul nastro. Una terza immagine viene creata che è una copia del primo ma tre volte le dimensioni: Ogni pixel è disegnato come un quadrato 2x2 con colum vuota a destra e una riga vuota al fondo. Questo sembra più come il vero e proprio schermo in cui i singoli punti sono leggermente distanziati. list8000 supporta la conversione di formati di file compresi dal 124 software FA-121 da Casio (vedi sotto): formato CAS per FA-121 e il formato CAT per FA-122 in poi. Con un cavo seriale corretto da Casio o Computing Giallo - le loro mappe cavo USB FX-Interface a una porta seriale normale - è possibile connettere tutti i recenti calcolatrici grafiche con connettore a tre pin round. La porta USB integrata di alcune calcolatrici non può essere utilizzato direttamente per FA-124 non supporta in modalità tradizionale (FA-123) che è richiesto dal formato CAT. Ci sono alcune cose da considerare: il file CAS: Utilizzare - CAS opzione e di fornire un file di output che termina in. CAS. L'opzione può essere seguita da un indicatore cosa mettere nel file: Tutti gli oggetti, i programmi, i file di redattore, di memoria o solo informazioni Range. Il formato di file CAS è usato da FA-121, un vecchio programma Windows a 16 bit. Si dovrebbe limitarvi a 83 nomi di file per il file di output. file CAS possono anche essere importati dal software più recente FA. Nessuna conversione del codice avviene. Anche il top della linea calcolatrice di questa generazione, il CFX-9800G, dovrebbe felicemente eseguire tutti vecchio codice fx-8000G. Quando si apre un tipo di un file in FA-121, gli elementi mancanti come Factor vengono creati automaticamente, ma contengono solo informazioni di default. Utilizzare l'opzione - casP o - cas7 se si target un fx-7700GB, che supporta solo il trasferimento del programma. Quest'ultima opzione ha l'effetto di mettere il qualsiasi file editor di memoria variabile e in aree di programma A. B. ecc Il primo di questi, Prog A. contiene un programma per impostare le variabili A Z per i valori trovati nel file di origine. I nomi dei file Editor originali vengono salvate come commenti all'inizio di ogni programma generato. Nessun tentativo è fatto di tradurre tutte le chiamate di nome Prog. file di CAT: Usa - cat opzione e di fornire un file di output che termina in. cat. Questo file è accettato da FA-122.124. FA-124 deve essere in modalità tradizionale (tipo Modello: fx-7400G CFX-9850G), anche se si collega un calcolatore di recente. Un prefisso opzionale per la conversione nome del file di programma deve seguire l'opzione direttamente (vedi sotto). Se non avete un cavo a tre poli si può ancora provare l'opzione di conversione di FA-124 e trasferire il file convertito in modalità nativa FA-124 via USB. list8000 converte i programmi, file editor, variabili AZ e Range informazioni in entrambi i formati. Grafica andare in solo formato di file CAT. Tutte le informazioni sono scritte in un unico file. In un file CAT, i programmi vengono rinominati in base alla loro posizione nella registrazione sorgente. Se si salva a cassetta con un nome di file, questo sarà usato come un prefisso. Opzionalmente si può fornire il proprio prefisso dopo l'opzione-gatto. A nel prefisso diventerà la cifra zona di programma. Se non è presente nel prefisso, il programma 0 otterrà il prefisso del nome da solo, mentre le cifre da 1 9 vengono aggiunti i seguenti aree del programma. Le chiamate a Prog n vengono convertiti automaticamente in nome Prog. La registrazione su nastro non dispone di informazioni circa le aree di programma originali dei programmi salvati. Questo può causare problemi se si sta chiamando un programma dall'altro. Opzione - p permette di impostare l'area per il primo programma nel file per un valore diverso da 0. Ci sono alcune differenze più di sintassi tra le varie generazioni di Casios linguaggio di programmazione. In particolare le istruzioni SCL. Cl e Dt non possono essere convertiti nel formato CAT. Per ovviare a questo, alcuni comandi vengono sostituiti quando viene creato un file CAT. Questo dovrebbe evitare errori di sintassi, ma non può aiutare in tutti i casi. Per esempio. accesso agli array viene sostituito da accesso lista, ma se si basano su una mappatura specifica tra le variabili AZ e le matrici, è necessario modificare il programma. Il comando Mcl viene modificato per eliminare le variabili A Z e la configurazione lista 1 con 26 elementi. Aggiungere nella all'inizio del vostro programma di gestione arrray. Si dovrebbe regolare la dimensione lista manualmente dopo la conversione. I file di testo vengono memorizzati nella registrazione su nastro sotto il loro nome insieme con le loro password. Il formato di file CAT mantiene sia il nome e la password, ma dal momento che questo formato di file è ASCII si può semplicemente modificare le password fuori. Dont modificare il contenuto del file direttamente nel file gatto perché il campo di lunghezza non sarà più corrette file CAS non contengono le password. Grafica in un file CAT vengono convertiti in vari formati: Picture1 Picture3 contiene un immagine centrata (96x64 su uno schermo 128x64) in tre colori: arancio. blu e verde. Picture4 ha la risoluzione 96x64 originale in blu. Calcolatrici con uno schermo più ampio sarà rifiutarla (in effetti, devo ancora trovare una calcolatrice che lo carica.) L'immagine ad alta risoluzione non è convertito perché nessun altro calcolatrice può fare con esso. Nel primo esempio, il primo programma sul nastro sarà rinominato MYAPP-3.FX. La GT operatore di reindirizzamento è facoltativo per la creazione di file CAT e deve essere omesso per l'output di file CAS. Canon X-07 listX07 gestisce la Canon X-07. Supporta i file binari e WAV da solo CSalvare. Le sequenze di escape sono un po 'diversa dalle macchine Casio perché il set di caratteri è notevolmente diversa. Vedi qui per una lista completa. È possibile utilizzare il DOS o Windows estendono set di caratteri (pagine di codice, rispettivamente, 437 o 1252) sul uscita con l'opzione - c. Questo renderà molti caratteri speciali nelle stringhe o commenti, è entrato con la chiave GRPH sulla X-07, leggibile sul sistema. Se si desidera tradurre l'uscita più tardi con basX07 si consiglia di utilizzare l'opzione - e e si può usare l'opzione - c. Entrambi possono essere mescolati. Se viene rilevato un carattere esteso corrispondente nella pagina di codice selezionato, sarà in uscita invece della sequenza di escape. list74 gestisce la TI-74. Supporta file binari o file WAV. Un file binario può essere sia creato da wav2raw. essere estratto con opzione - r in un periodo precedente di list74. o provengono da l'interfaccia PC TI: salvato da un TI-74 (o CC-40) o creati dal compilatore TIC74. Utilizzare l'opzione - r se si desidera creare un file che può essere inviato per la TI-74 dal software di interfaccia per PC. Il nome del file deve seguire direttamente l'opzione char. Nessun elenco è prodotto poi. list74 lavora per file sequenziali scritti dispositivo 1. pure. Opzioni - e e il lavoro - c simile al listX07 ma il TI supporta i caratteri meno nazionali. Almeno alcuni caratteri speciali come auml, ouml, uuml o szlig possono essere utilizzati. Non possono essere inseriti direttamente sul dispositivo, ma possono scivolare attraverso l'interfaccia PC o apparire in file di dati. Creazione di file binari Tre programmi interpretare un file binario e creare un file WAV da essa che possono essere trasferiti alla calcolatrice tramite la scheda audio. I programmi sono wave730. wave850 e waveX07. Il primo programma gestisce la Casio PB-100 della serie, vale a dire l'FX-730P e, come effetto collaterale, l'FX-702P (ma il nome del programma memorizzato nel file non sia correttamente visualizzati sullo schermo.) Il secondo è scritto per l'altra calcolatrici BASIC che iniziano con il PB-700, vale a dire l'FX-850P. waveX07 gestisce la Canon X-07. Le sequenze di piombo-in sono più brevi rispetto a un file originale proveniente dall'interfaccia nastro. Ciò consente di risparmiare tempo durante il caricamento dei file. La FP-200 ha bisogno di un po 'più lunghi lead-in: utilizzare l'interruttore -2 Creazione dalla sorgente BASIC file di Questi programmi prendono un file sorgente, che potrebbe essere stato creato da uno dei programmi di utilità della lista o semplicemente digitato sul PC, e creare un tape file in uno dei seguenti formati di file: da esso WAV, file binari o file codificato ASCII per interfaccia seriale Piotrs. I programmi sono bas702. bas730, bas850 e basX07. The last two can create plain ASCII source files for transmission through a serial interface. BASIC programs can be written with lowercase or mixed case keywords. The utilities translate everything outside strings, comments or DATA lines to uppercase before further processing. Uppercasing can be suppressed for the newest machines which support case sensitive variable names. You can use a single apostrophe () instead of REM to start a comment. This is natively supported on the FX-850P and later models and on the X-07 but not on the older machines where it will be translated to REM or :REM depending on its position. Lines that do not start with a line number are ignored. This way you can have lenghty comments in your source code which are not downloaded to your pocket computer. Different generations and lines of pocket computers use different BASIC dialects. The differences are sometimes huge and sometimes very subtle. This ranges from the almost exotic FX-702P BASIC variant with abbreviated keywords like PRT instead of PRINT to minor quirks like the lack of USING in the FX-850P or the renaming of the logarithm functions in the PB-700 and PB-1000. The translators know about some of these specifics and try to bridge the gaps with special options. Of course some restrictions like variable name syntax or memory organization or the lack of functionality cannot be overcome. But I tried hard to avoid these nasty SN Error or ERR-2 messages resulting from unknown keywords where a perfect replacement on the target machine exists. VAC vs. CLEAR is a good example for this. Within the same family, some commands are valid for one machine but not for the other. The statistics functions of the FX-750P are unavailable on the PB-700. bas850 translates these functions to tokens but the PB-700 cannot list or execute them. This is equally true, if you load a programm written on and saved by the FX-750P directly into a PB-700. You will find a detailed analysis of the various BASIC dialects in my BASIC Comparison Sheet . You can translate source files especially written for the FX-702P or from newer Casios standard BASIC keywords like PRINT or INPUT are automatically translated to the special syntax of the FX-702P. The prefix FACT function is replaced by the FX-702P postfix factorial . Some unkown commands like REM or DATA are completely removed. This can lead to lines being deleted and therefore unavailable as jump targets. The PB-700PB-1000 logarithm syntax is supported with the - l option. The FX-702P supports only one array named A(). On the PB-100 series you better use Z() after DEFM when you do not want to overlap your standard variables with your array. bas702 translates the arrayname Z() to array A() to emulate this behaviour. bas702 supports escape sequences anywhere in the code in order to allow the use of the special characters of the pocket computer. An escape starts with a backslash character followed by either one or two characters (see table below) or a two digit hexadecimal code. Set the - e switch on list702 to include these sequences in a program listing Here is the character map: Code 0F is used as the space character. The BASIC tokens range from 60 to AF. The character escape sequences are: DG (deg), gt (greater or equal), lt (less or equal), ltgt (not equal), PI and E (exponent). These are case insensitive: PI and pi are equivalent. The strings gt. lt. ltgt. PI and E in numbers are automatically translated when they occur in normal code. There is no need to escape them, except when you want to use them in strings. The character is treated as deg. is the up arrow and is PI. and are lt, gt and ltgt respectively. So in order to print the character pi, any of the following will do: PI. pi. Pi or 3B. Outside of strings, PI. pi or Pi are also valid. FX-730P family If you have a source file from an FX-702P, which uses some special keywords like PRT or INP. translate your source with the - o option. If you want to port a program from one of the newer machines like the FX-850P, try option - n. The program does its best to translate to the older or newer syntax, but it is not foolproof. The FX-702P postfix factorial is translated to the prefix FACT function. The PB-700PB-1000 logarithm syntax is supported with the - l option. Since the BASIC of the PB-100, PB-300, FX-701P and FX-801P lacks some keywords, notably REM. use option -1 if you want to target one of these. The unknown commands are then excluded from the output. This may lead to lines being dropped as a whole. Their line numbers are no longer available as jump targets Options - n and - o are mutually exclusive. Option -1 may be combined with either one. bas730 supports escape sequences anywhere in the code in order to allow the use of the special characters of the pocket computer. An escape starts with a backslash character followed by either one or two characters (see table below) or a two digit hexadecimal code. Set the - e switch on list730 to include these sequences in a program listing Here is the character map (courtesy Piotr Piatek): Code 00 is used as the space character. The BASIC tokens range from 80 to D1. The character escape sequences are: gt (greater or equal), lt (less or equal), ltgt (not equal), PI. E-. E (exponent), SD. SL (small caps), GA (gamma), SI (lowercase sigma), -1 (small), . (quotes) (circle), SM (Sum), DG (deg), (triangle), (multiply), : (divide), SP (spade), HT (heart), DI (diamond), CL (club), MU (micro), OM (omega), YN (Yen), SQ (square), . (dot) and (block), (backslash), (gray block), (thick slash), Bgt (B) and TA (tau). These are case insensitive: PI and pi are equivalent. The strings gt. lt. ltgt. PI. E - and E in numbers are automatically translated when they occur in normal code. There is no need to escape them, except when you want to use them in strings or comments. The character is treated as deg. . and are the left, right, up and down arrows. So in order to print the character pi, any of the following will do: PI. pi. Pi or 1B. Outside of strings, PI. pi or Pi are also valid. PB-700 and FX-850P families and the FP-200 - tT format is just plain text with all source text translations performed. You can send the result directly to the serial or USB interface. The outfile can be omitted, the output goes to standard out then. This way, you can send the output directly to other utilities like md100. In Windows, the following commands will setup the serial port and send the file directly to the pocket computer: The mode command is necessary only once. On an FX-850P use LOADCOM0:6. to load the file. Ive tried this successfully with the USB-interface by Manfred Becker (see below .) - tA format is compatible with the PB-700, FX-850P series machines and the FP-200. But its slow because each program line is preceeded by a lead-in sequence of about two seconds. This is necessary because the computer needs some time to compile one line in memory before the next line arrives. This is still better than typing the code in. The FP-200 and the FX-850P support - tB format, a blocked variant of the - tA format. Blocking creates less but larger blocks and is therefore faster to load but cannot be used for the PB-1000. The -2 switch sets all relevant options for the FP-200 and adds some special quirks. If you target to this machine, use the -2 switch - t2 creates a binary file for the FP-200. It sets the -2 switch as well. To get a program from the PC into your PB-700, PB-770 or FX-750P, use switch - t7 to create a binary file. This will be much faster than - tA . - t8 is preferable over - tA or - tB if you target the FX-850 or the PB-1000. For the latter, - lF is needed as well, if you are using the correct LGTLOG syntax of the PB series. The token table only contains the FX syntax LOGLN keywords. The - lF switch takes care of the source text translation before the tokenization takes place. There is another caveat: The token table contains all keywords for all known variants of JIS BASIC. If your program uses such a keyword as a variable name on a machine where it is not a reserved word (e. g. VAC which is a replament for CLEAR on the FX-850P but free for use on the PB-1000) the tokenizer will accidently translate your variable name to a token. Rename your variable or use - tA mode instead In any case, be careful to select a speed ( - w or - f ) that is supported by your pocket computer Use - u if you plan to load the file into your FX-750P: This machine does not support lowercase letters On the other hand, option - l allows lowercase variable names and keywords as accepted by the newer machines otherwise, everything outside strings and remarks is translated to uppercase. If you have a source file from an FX-702P or from the PB-100FX-730P series, which have some special keywords like VAC, the - o option might help. The program does its best to translate to the new syntax, but it is not foolproof. The FX-702P postfix factorial is translated to the prefix FACT function. There is a problem with the different meanings of LOG, LN and LGT in the various versions of Casio BASIC. The PB-700 series, the PB-1000 and the FP-200 use LGT for the base 10 logarithm and LOG for the natural logarithm. The other machines use LOG for base 10 logarithm and LN for the natural logarithm. If your source file specifies LOG and LN but you want to transmit the file to a PB-700 or PB-1000, specify - lP to force a translation. In the opposite case, specify - lF if you transfer, for example, a source from a PB-700 to a FX-850P. If your source file already contains the correct logarithm functions, do not specify a conversion There is an Exception: If you are creating a binary file for the PB-1000, you need to use - lF (see above.) With option - d data files can be created for all machines. As a modern PC does not allow the pausing of the sound output to the tape interface by means of a Remote plug, there is the ltdelaygt parameter. It controls the time in tens of seconds between data lines or blocks. You may have to increase this value from its default (two seconds in non blocked mode, four seconds in blocked mode) if you program misses data. There are differences between the PB-700 and later systems. A PB-700 PUT command creates an unnamed tape file with as many lines as there are items in the command. Later systems use OPEN and CLOSE to create named files with as many lines as there are PRINT statements. The FP-200 and the FX-850P support large blocks of several records before a new lead-in sequence is output. Option -2 forces this mode. For other systems just set the the ltcountgt parameter of option - d to B. Here are a few examples: PB-700: bas850 - w - d30,1 DATAFILE. DAT DATAFILE. WAV This matches a single variable as in GET A. Set option - d30,3 for GET A, B,C. The value 30 for the lead-in time is arbitrary. In most cases the default of 20 works fine. For each tape file, two blocks are written to the wav-file, header and data, each with its own lead-in of the requested length FX-850P: bas850 - w - d, B DATAFILE. DAT DATAFILE. WAV This will create a file with large data blocks. The lead-in time per block is 40 in this case. You can try to decrease it to 30 or some such. FP-200: bas850 - w - d -2 DATAFILE. DAT DATAFILE. WAV Option -2 forces large blocks and a modified line end (CR LF). This is FP-200 specific. bas850 supports escape sequences anywhere in the code in order to allow the use of the special characters of the pocket computer without resorting to the CHR function. An escape starts with a backslash character followed by either one or two characters (see table below) or a two digit hexadecimal code. Set the - e switch on list850 to include these sequences in a program listing Here are the character maps for the PB-700 and the FX-850P (courtesy Casio and some editing by me): PB-700 and PB-1000 character map. The FP-200 uses a reduced version of this map. FX-850P character map. Also valid for VX and Z machines. The character escape sequences for the FX-850P are: AN (Angstroumlm), IN (integral), RT (root), (over), SM (Sum), OM (omega), (gray block), (block), AL (alpha), BT (beta), GA (gamma), EP (epsilon), TH (theta), MU (micro), SI (sigma), P S (psi), S0. S9. S. S-. SN. SX. -1 (superscripts), : (divide), . (dot), DG (deg), gt (greater or equal), lt (less or equal), ltgt (not equal), . V. lt-. - gt (arrows), PI (pi), SP (spade), HT (heart), DI (diamond), CL (club), SQ (square), (circle), TR (triangle). (multiply), PN (pound), CN (cent), -. - (signs), YN (Yen), (backslash, same as Yen). These are not case sensitive: PI and pi are equivalent. The symbolic escape sequences help in porting software from the older PB-100FX-700 series machines and are easier to remember. Just use the - e switch on list730 . Use option - uF if you have created the source text in UTF-8 format. A complete list of the supported extended characters is contained in the following document: CasioFX-850PCharset. pdf With option - eP set on bas850 . a different set of character escapes is used, because the PB-700 and PB-1000 support a different character set. Hexadecimal escapes are not affected by this option. The following codes are used instead (some looking a little strange, like the arrows): 1. 8 (horizontal bars), 1. 7 (vertical bars), (over), (gray block), (block), . (dot), DG (deg), . V. lt-. - gt (sort of arrows), SP (spade), HT (heart), DI (diamond), CL (club), LD (large dot), (circle), TR (triangle), YN (Yen), (backslash). Use option - uP if you have created the source text in UTF-8 format. A complete list of the supported extended characters is contained in the following document: CasioPB700Charset. pdf On the PB-700 and the FX-750P, lines with escape codes beyond 7F cannot be edited because the codes are replaced by their corresponding keywords when using LIST or EDIT. You can still LOAD and RUN such a program. Code F0 (multiplication sign) is not allowed on these machines because it breaks the transmission protocol. It can only be used in the form CHR(ampHF0). Canon X-07 The program supports three output formats: - b creates a binary file, used mainly for debugging the tokenizer or later translation with waveX07. - w creates a WAV file which can be fed to the computer via the sound card. - t creates plain text but all source text translations are performed. The delay value inserts a short break for the slow X-07 and controls the line termination: CR only if a delay is specified, the system default (CRLF for DOS, LF for Unix) without delay. The output can be sent to your machine directly via the serial interface (see below for details.) The Canon X-07 has an extended character set with many special characters for foreign languages like French or German. You can use your favorite editor in DOS or Windows and type text in strings, comments or data lines without worrying about the encoding. If you are on DOS use option - cD. on Windows use option - cW. If your text is in UTF-8 format use option - cU. Escape sequences are supported as well such as :A for Auml or e for eacute. The complete list is in the following document: CanonX-07Token. pdf. You can use binary escape sequences like 86 for Auml. pure. A single backslash serves as the marker for an escape sequence. Therefore, in order to enter a backslash for the integer division, you need to encode it as (or YN because it is displayed as the Yen symbol yen on the machine). Using the serial interface on the Canon X-07 to enter a program The Canon X-07 lacks the ability to load an ASCII program with the LOAD command from the serial interface. Instead, it can be remotely controlled from another computer or terminal over the serial line. This way, an ASCII file can be simply typed in from the controlling system. To enable this feature, it is easiest to type in a small program first: The program is now ready to be run from the memory disk with RUNREMOTE. Before you start downloading, make sure to delete the current program. Otherwise, new lines will be merged with existing ones. You can now send your source from the PC. The following example is for a command prompt on Windows: The mode command is necessary only once. The basX07 command assumes that you have entered the text with a windows editor and you want to translate extended characters from Windows to the machines character set. If you see obvious garbage on the display, then the X-07 was too slow to read and store all the lines. You will then need to reduce the speed further or increase the delay after option - t . Turning the machine off and on returns control to the keyboard. An example: Dumping the memory of a PB-770 Here is a short example on how to get the RAM contents of a PB-770 as a binary dump file into your PC. This does not work for the FX-750P or the PB-700 because they lack the necessary PEEK function. Only RAM can be accessed, PEEK does not read out the ROM contents. PEEK(ampH0000) and PEEK(ampH8000) return identical values. PB-770 BASIC source The following source text should be created on the PC and transferred to the PB-770 via sound card: Save the file as pb-dump. txt and translate it to a WAV file: The wav file can now be downloaded to your PB-770. A simple LOAD on the machine will do. Getting the data into your PC Set up your recording software on the PC and start recording. You will need a lot of space. About half of the recording will be silence which you can edit out later if you like. Now run the program and enter the start address and the number of kilobytes to transfer. RAM seems to start at address 0000. Without RAM expansion, the size is 8 kb. Each block of 256 bytes takes about 75 seconds to collect and another 70 seconds to write out. This totals to about 80 minutes for 8 kb of RAM. After the last block has been written, save the recording as a WAV file, lets say as dump. wav . Converting the data The following command converts dump. wav into a readable format: The conversion takes its time because of the size of the WAV file. The file dump. txt can be inspected with an editor or treated with the following simple C program: The filenames dump. txt and dump. bin are hardcoded into the source. Feel free to improve it. The binary file is updated with each run of the program so that you can upload the dump in chunks of your liking. The new data will be inserted or updated in the correct position of dump. bin . Download all files including Windows executable of undump. exe here: mvcsys. dedownloadpb-dump. zip How to handle floppy disk images Creating an image An MD-100 image is a file that contains the sectors of a real 3.5 floppy disk. The disks are written with 80 tracks and 16 sectors of 256 bytes length on each track. Only one side of the disk is used. I use double density disks (without the second hole in the case) but high density disk may work if you cover the hole with black tape. You should format the floppy in the MD-100 drive. Now you need access to a Linux PC. Sorry, I havent written software yet to copy the disk under DOS or Windowsreg. In order to access the disk physically you need to tell the floppy driver about the format of the disk. Ive had success with the package fdutils-5.5 . In the Linux subdirectory of casutil youll find shell scripts to setup the drive, read and write floppies. The setup script makedev. sh creates the device devfd0casio and configures it with setfdprm SS DD ssize256 sect16 . Copying is done with dd . The sample script getmd100.sh creates an image file named md100.img . The md100 program can create an image if you precede the image name by the option - c. It is possible to create disk images of up to 512 blocks instead of the default 320 blocks, but these cannot be written back to a real disk. A new image is filled with empty blocks. The option is mostly ignored if the image already exists but you can increase the maximum allowed size of the image with its parameter. Writing to a floppy The image created in the step above can be written back to a real floppy in pretty much the same way. A sample script putmd100.sh is provided in the linux subdirectory. Manipulating files A single program, md100 . does all the manipulations to the disk image (or the real disk on some operating systems, see below .) Patterns are DOS style, but you can use for all files. Wildcard expansion on local files depends on the platform. On Linux this is automatic, on other platforms it depends on the compiler. The Borland compiler has wildcard support, the library wildargs. obj is automatically linked in by the compile jobs provided with the package. Patterns for files on the floppy must be included in double quotes. MD-100 filenames and types The MD-100 filenames are only eight characters long plus three characters for a file extension. Filenames can contain many characters not allowed on your PC. Case is respected just like on Unix file systems. There are no subdirectories on an MD-100 floppy. Files have an additional attribute, the file type. Both the PB-1000 and the PB-2000C use the file type to select the correct handling of a file selected from the menu. I know of the following types: S - Sequential files, including MEMO files, assembly source files, C data files, files loaded via RS-232C and BASIC programs saved with SAVE, A. Sequential files are opened with the MEMO editor and can be read and written by BASIC or C programs. The contents is ASCII text with CR LF delimiters. R - Relative or Random data files. They can only exist on a disk, not in PB-1000 RAM. C does not use type R files. The contents is defined by the BASIC FIELD statement. M - Machine code files, created by the PB-1000 assembler. B - BASIC programs in internal representation. C - C source or BAT files. The contents is ASCII text with CRLF delimiters, just like sequential files. The PB-2000C can change the file type between C and S from the menu. The PB-1000 misinterprets a type C file and thinks it is a type R file. Consequently it refuses to copy such a file to RAM. There is an additional attribute byte stored in each directory entry on the disk. Bit 0 is used to protect a file. You can set or select the attribute byte with the - p option. Space allocation is done in blocks of 4 sectors (1KB) each. The size in bytes is computed by multiplying the total number of sectors by 256 and searching backwards the last sector of the file for the EOF marker 1A. The marker is added even on empty files. The following examples assume that you have an image named md100.img in the current directory and that the md100 executable is in your path. Listing the disk directory If you want to specify a pattern, the command name dir must be spelled out: The double quotes around the patterns are essential The - i option forces a case insensitive search. You can use the - u or - l options to convert all filenames to upper or lower case. With the options - t andor - p the listing can be restricted to files of a certain type or with a certain protection setting: Listing files Files on the image can be displayed as text with the type command: (Ask me for a complete listing. The authors pages have seemingly gone.) The file name(s) can be patterns and the options - i. - t and - p do also work. If more than one file is specified, each listing is preceded by the filename and a colon. Listings can be binary (hex dump) or ASCII (the default for most file types). You can force a specific listing style with the options - b or - a : As you can see, BASIC programs are decoded from their internal, tokenized form. I cannot guarantee that the decoder works correctly in all cases, save your programs in ASCII from the calculator if you want to be on the safe side Option - e creates the same escape syntax as list850 does. Copying files to the PC The commands get and mget copy single or multiple files from the image to your PC. The only difference is that get just copies one file (in case of a pattern the first that matches) while the second argument is the new name given to the file on your PC. With mget you can copy a bunch of files in one go but your options to rename the files on your PC are limited to a directory name given with the - d option. Both commands allow the file selection options - i. - t and - f and the case conversion options - l and - u . Use get to copy a single file: This will copy the binary file, not the ASCII code of PI. BAS. You can specify no destination at all (defaults to the current directory), an explicit name, a directory ending in or a name ending in . The trailing in the destination filename is replaced by the source file name. If you want an ASCII copy (just like the type command) specify the - a option. Escape syntax can be created with the - e option: If you want to copy multiple files, use mget : The destination (after the - d option) must end in a directory delimiter or . This is prepended (without the trailing ) to the filename from the floppy image. The source filename pattern(s) must be enclosed in double quotes to prevent the shell from interpreting the wildcard characters. Some characters from the source file name are translated to an underscore. Copying files to the floppy image The commands to copy PC files to the floppy image are put and mput . Again, the main difference is that put copies just one file while mput copies a bunch of files in one go. When copying files to the MD-100 image or the floppy, you need to decide which type to assign to the file. The md100 program tries to guess the file type from the extension correctly:.c ..h and. BAT files are of type C..BAS is type B..REL is type R and all others are type S. You can override this with the - t option. The protection attribute is set to 0 by default but can be changed with the - p option. Files saved on your PC with mget in binary mode should be copied back with the - b switch set. This ensures that the file is transferred unchanged to the floppy image. PC text files should be transferred with the - a switch set to ensure ASCII mode. This way, the correct line termination ( CR LF ) is forced on the destination file. ASCII mode is default for all files except types M. R and B. Escape syntax is supported with the - e option, just like in bas850 . If you are unsure whether a copy command will do what you intended, use the option - n before the image name or between the command and its parameters. This prevents updates to the image or the floppy. Use put to copy a single PC file to the image: Since no destination filename was given it was built from the source file. The - u option forces the name to be all upper case. The - e option interprets escape sequences like PI or 80 and translates them to their binary equivalent. The file PI. ASC can later be opened on the PB-1000 with the memo editor or it can be loaded from the BASIC command prompt with LOAD0:PI. ASC. The BASIC interpreter compiles the file to internal format upon loading. You can use piping with the put command if you replace the source filename with stdin or stdin. EXT. Its better to provide a destination filename with a proper extension. Otherwise, the file will be created under the name stdin. EXT . Here is an example: The option - lP of bas850 will translate the fx-850 logarithm syntax LOG LN to the PB-100 syntax LGT LOG . With put and mput . destination names can be patterns included in double quotes. In order to copy all files ending on. asc on your PC to the floppy image and renaming them to be all lowercase and to end on. txt . enter the following command: Note the double quotes around the MD-100 pattern. txt but not around the PC pattern. asc . The third column is the size in blocks. Renaming or deleting files and setting file attributes The commands ren , del and set change the directory of the floppy image. They all work on file patterns or on single files. To rename all BASIC files to lower case with the extension. bas use the following command: As usual, all patterns must be enclosed in double quotes. With the ren command, all patterns except the last are considered source files, the last pattern forms the new name(s). To delete some C files from the image, enter: Use option - tC and the pattern to delete all type C files. To change all type C files to be of type S and alter the protection attribute, enter: This allows access to the files created by the PB-2000C from a PB-1000. The protection attribute is supposed to protect the file against writing. Direct floppy access On Linux, you can replace the image name in the md100 commands by devfd0casio . the device created with makedev. sh. All operations are directly performed on the floppy. Thats much slower than manipulating an image but you save the work of copying the image back and forth. On Windows youll need an additional package, LibDsk. This is a library to directly access floppies in various formats. See the file readme. txt in the win32 subdirectory. The library is cross platform and it should be perfectly possible to use it on other platforms. I simply havent tried it, yet. You can set the - DLIBDSK switch of your C compiler and try for yourself. To access the floppy, replace the image name with A: . Ive written an OS2 floppy access module as well, but that doesnt work, I keep getting read errors. My interest in OS2 has ceased so updates are unlikely. -( BASIC Comparison Sheet Ive made an attempt to compare the various BASIC dialects of different pocket computers in tabular form: Download page. The link points to the online version of the download page, a local copy is part of this package. The comparison includes Casio, Sharp, HP, TI, Canon and Epson machines. Casio Pages The following Internet sites have more or less influenced my work. More links can be found on these pages. Piotr Piatek has inspired much of what you can find here. Some recent bug fixes and contributions, e. g. direct floppy access from DOS, are by him. He has a deep insight in Casio hardware and has even built the interfaces himself. Visit his site at pisi. plpiotr433index. htm Ledudus site, dedicated to Casio calculators and pocket computers, with many pictures and links: ledudupockets. asp (English and French). Information about the PB-700 can be found on the pages of Christophe le Glatin, now hosted by Ledudu: casio. leduducasiopb700casiopb700.htm. Some French required. Thomaacutes Wrobel has collected technical information about the PB-1000: itkp. uni-bonn. de Viktor Toths rskey. org is a site that deals with many programmable calculators, among them several Casio models: rskey. org . The Pocket Computer Museum has many pictures and technical data. It hosts some software for Sharp pocket computers: pocket. free. frindex. html . SilRun Systems (Silent Runner) hosts many scanned Casio manuals: silrun. de . Manfred Becker has created a USB interface and a BASIC program editor for the FX-850P and its successors: manib. ma. funpic. dedetaschenrechner. htm (German pages only). The various file formats of Casio graphics calculators are the topic of the Casio file format documentation project. casetta. tuxfamily. orgformats . Casios communication software FA-124 can be downloaded here: world. casioeduresourcesfa124 Floppy access LibDsk . the library used to access the floppy to manipulate MD-100 disks is written by John Elliot: seasip. demon. co. ukUnixLibDsk . The auxiliary Windows driver fdrawcmd that LibDsk uses is the work of Simon Owen: simonowenfdrawcmd . Contact: Marcus von Cube ltmarcusmvcsys. de gt Page last updated: March 15, 2015ImageMagick v6 Examples -- Color Modifications To explore these technqiues we will need a test image. Dont worry above how I actually generated this image, it is not important for the exercise. I did design it to contain a range of colors, transparencies and other features, specifically to give IM a good workout when used. If you are really interested in the commands used to generate this image you can look at the special script, generatetest , I use to create it. WARNING: The color processes below generally assumes the image is using a linear colorspace. Most images are however saved using a sRGB or Gamma corrected colorspace, as such to get things right colorspace correction should also applied first. Converting Color to Gray-Scale Gray scale images can be very useful for many uses, such as, furthering the processing of the original image or for use in background compositions. The best method of converting an image to gray-scale is to just ask IM to convert the image into a gray-scale Color Space representation for the image. Note how the blue is much darker than the red, due the weighting to match the intensity as they seem to appear to the human eye. That is, red is quite a bright color compared to blue which looks darker. This is equivelent to the use of the rec709luma conversion formula with the dedicated - grayscale operator (Added IM v6.8.3-10). The rec709luma value is just one of many greyscaling formula that has been defined for use by the - intensity setting (see below). Here for example is the other common greyscaling formula rec601luma As you can see there is a slight different in intensity levels for the different red, green and blue color channels. However there a many other methods, and meanings of gray-scale. For example, you can drain all the color out of the image by using the Modulate Operator. to set all color saturation levels to zero. This essentually converts the image to the HSL colorspace, and extracts the grayscale Lightness value from that colorspace. However using a - define modulate:colorspace you can specify other colorspace models to use. See Modulate in Other Colorspaces below. Note how the IM green color I used for the center colored disk in my test image is not actually a pure green, such as used in the colored rainbow, but the half-bright green defined by the new SVG -- Scalable Vector Graphics standard. If you need a pure RGB green you can use the color lime instead. See Color Name Conflicts for more detail. Another way is to use the FX DIY operator to average the three channels together to get a pure mathematical meaning of gray-scale. The average of sRGB channel values also equivelent to the intensity channel of OHTA colorspace (red channel). Or the I channel of HSI. colorspace. Another technique is to simply add all three channels together (a color measure known as manhatten distance) and while the resulting image will not loose information due to quantum rounding effects, you may loose information about the brightest colors. Unfortunately, you also loose the transparency channel, too. You can use the same adding channels technique to control the weighting of the individual color channels. For example this is one DIY formula that you can use. The above would suffer from quantization effects for a ImageMagick compiled at a Q8 Quality Level. That is because the results of the - evaluate will be saved into a small 8 bit integer, used for image values. Only later are those values added together with the resulting loss of accuracy. An ImageMagick compiled with Q16, or better still the HDRI. quality compile options will produce a much more exact result. Another new alternative is the Poly - Weighted Image Merging Operator. which will do the weighting and addition of the separated channel images in one operation, so avoiding quantum rounding effects. A similar technique can be used to generate a pure mathematical gray-scale, by directly averaging the three RGB channels equally. However as you can see, I did not attempt to preserve the alpha channel of the resulting image. Another fast alternative is to use the - recolor color matrix operator, which will let you specify the weighting of the three color channels. This doesnt affect transparency, but makes it a much better way of converting colors using a specific weighting. Basically the first row of numbers is the channel weighting for the resulting images red channel, next 3 for green, and the final three numbers for blue. You can also use - type to tell IM to treat the image as gray-scale, when either reading or writing the image. The - type setting is generally only used as a guide when an image is being read or written to a file. As such its action is delayed to the final write of the image. Its effect is also highly dependant on the capabilities of the image file format involved and is used to override ImageMagicks normal determination during that process. See the Type examples for more information. Before IM v6.3.5-9 the above will have removed any transparency in the written image (equivalent of a - type Grayscale ) due to a bug. This was fixed as soon as I noted the problem and reported it. (There is a lesson here :-) A much more interesting technique is to extract a variety of different meanings of brightness by extracting the appropriate Color Channel from various Colorspace representations of the image. Examples see Grayscale Channels from Colorspace Representations. Image Level Adjustments The most basic form of adjustment you can make to images are known as level adjustments. This basically means taking the individual RGB color values (or even the alpha channel values) and adjusting them so as to either stretch or compress those values. As only channel values are being adjusted, they are best demonstrated on a gray-scale image, rather than a color image. However if you adjust all the color channels of an image by the same amount you can use them with color images, for the purposes of either enhancing, or adjusting the image. Do not confuse this with the more automatic form of level adjustments, which we will look at in the next major section of examples below, Normalize Adjustments. This function will do exactly the same operation regardless of the actual content of the image. It does not matter if the image is bright, or dark, or has a blue, or yellow tint. The operations are blind to the actual image content. In demonstrating these operations I will be using a modified gnuplot graph such as shown to the right, which I generate using a special script imgraph . The graph has a red line which maps the given original x value (representing the gray-scale value of the top most gradient) to the y value shown. The resulting color gradient is also shown underneath the input linear gradient. The graph shown to right is of the IM - noop operator which actually does nothing to an image. As such each of the images color values are just mapped to exactly the same value without change. The lower gradient is thus the same as the upper gradient. Image Negation The simplest and most basic global level adjustment you can make is to negate the image, using the - negate image operator. Essentially this makes white, black, and black, white. adjusting all the colors to match. That is, it will make the color red, its complementary color of cyan, and blue, yellow, etc. You can see this with the mapping graph shown below, as I use the - negate operator on both the test image and the standard IM rose built-in image. Note how the lower gradient in the mapping graph image is now reversed, so that black and white are swapped, and the same reversal appearing in the negated test image. Note that 25 is a huge contrast enhancement for any image, but it clearly shows what it does. You dont have to change both the black and white points. Instead it is quite permissible to just adjust only one end of the color range. For example we can make a very light, or a very dark rose image. However I again warn you that the colors outside the given range are clipped or burned, and as such will no longer be available for later image processing. This is the biggest problem with using a - level operator. By using a negative value you can do some rough de-contrasting of an image. What this means is that rather than providing a color value for the values to be mapped to black and white and thus stretching out the colors in between, you instead compress the color values so as to map the imaginary negative color to black or white. The result is a general graying of the image. This method of de-contrasting an image however is very inaccurate and not recommended, unless you have a IM older than version 6.4.2 where you dont have access to the new Reversed Level Operator. You can use the - level operator to negate an image (as previously shown above, just by swapping the black and white point values given, using - level 100,0 . Or by setting them to the same value, you can effectively call all the color values in the image to be thresholded. Using - level to threshold an image is exactly the same as if you used a Threshold Operator with that value. The mapping graph shown right, shows the results of a - level 50,50 operation, and its effect on a grayscale gradient. Note that unlike - threshold the image is not automatically converted to a grayscale image when used with the default - channel setting. The general nature of using level to linearly modify an image, makes the - level operator good for general gray-scale image modifications, and mask adjustments. Add the fact that you can modify individual channels (using the - channel setting) as opposed to the whole image, makes it one of the best color modification operators available to IM users. Note you can also use the Evaluate and Function Operators for a more direct mathematical modification of the color values, to achieve the same results for - level both and - forms). Be warned that the - level operator treats the transparency channel as matte values. As such 100 is fully transparent and 0 is opaque. Please take this into account when using - level with a blurred shape image. This is most typically done after blurring an shape image, to expand and stretch the results. For examples of this see Soft Edges. and Shadow Outlines. Reversed Level Adjustments -- Decontrasting Images As of IM version 6.4.2 the Level Operator was expanded to provide a reversed form level (note the plus). Alternatively you can use the original - level form of the operator but add a . to the level argument given (for older API interfaces). The arguments for this variant is exactly the same, but instead of stretching the values so as to map the blackpoint and whitepoint to black and white, it maps black and white to the given points. In other words level is the exact reverse of - level . For example here we map black to a 25 gray, and white to 75 gray, effectively de-contrasting the image in a very exact way, using the two methods of specifying the reversed form. If you compare the above level 25 operation with the use of a a negative de-contrasting, - level -25 operator we showed previously, you will see that are not the same. The plus version produces a much stronger de-contrasted image (it is greyer), but does so by mapping to the exact values you give the operator, and not the imaginary values the minus form used. This exact value usage is important, and one of the reasons why the plus form of the operator was added. Of course a 25 is again a very large value, and it is not recommended for use with typical image work. Note that the - level and level , are in actual fact the exact reverse of each other when given the same argument. That is, one maps values to the range extremes, while the other maps from the range extremes. For example here we compress the colors of the test image using level , then decompress them again using - level , so as to restore the image close to its original appearance. The two images appear to be very very similar, and as I am using a high quality Q16 version of IM, you will be hard pressed to notice any difference at all. However the values may not be exactly the same, as you have effectively compressed the color values of the image to a smaller range of integers, and then restored them again. In extreme cases this can result in Quantum Rounding Effects. Doing these two operations in the opposite order (stretch, then compress the color values) will produce Quantum Clipping Effects. One other useful aspect of the level operator is that you can completely compress all the color values in an image to the same gray-scale level. By specifying levels according to the values of specific colors for each individual channel, you can effectively convert a greyscale gradient into a specific color gradient. However this is rather difficult to calculate and do. As such a - level-colors operator has also been provided that will let you specify the black and white points in terms of specific colors rather than level values. See Level by Color below. Level Gamma Adjustments Both the above - level variants also allow you to use a third setting. The gamma adjustment value. By default this is set to a value of 1.0 , which does not do any sort of mid-tone adjustment of the resulting image, producing a pure linear mapping of the values from the old image to the new image. However by making this value larger, you will curve the resulting line so as to brighten the image, while shrinking that value will darken the image. For example here I use just the gamma setting to brighten and darken just the mid-tones of the image. Values generally range from 10 for a blinding bright image, to .2 for very dark image. As mentioned a value of 1.0 will make no gamma changes to the image. However the special value of 2.0 (see above) can be used to get the square root of the images normalized color. Both versions of the - level operate handles gamma in the same way. This means you can combine the level adjustment of the black and white ends with a non-linear gamma adjustment. You can also only adjust a single channel of an image. For example, here we give an image a subtle tint at the black end of just the blue channel, while using gamma to preserve the mid-tone color levels of the image. This specific example could be used to tint a weather satellite photo, where only the sea is pure black, while land is more grey. Other alternatives to this blue channel adjustment are given below in DIY Mathematical Non-linear Adjustments. Gamma Operation Adjustments The - gamma operator is also provided, and has exactly the same effect as the gamma setting in the - level operator. However it will let you adjust the gamma adjustment level for each individual channel as well. Its real use is in adjusting the gamma function of an image before performing linear operations on them. For more details see Human Color Perception and Gamma Correction. We can also use this function to brighten the image differently for each individual RGB channel. For reasons about why you should used this function see Gamma Correction. This function actually equivelent to the Evaluate POW function but with the argument inverted. As such a - evaluate POW 2.2 will actually do a - gamma 0.45455 (0.45455 is equal it 12.2) operation, which is the reverse of a - gamma 2.2 . One of the less obvious uses of - gamma is to zero out specific image channels (see Zeroing Color Channels ). Or color an image completely black, white or some other primary color (see Primary Colored Canvases ). Level Adjustment by Color The - level-colors operator was added to IM v6.2.4-1. Essentially, it is exactly the same as the Level Operator we discussed above, but with the value for each channel specified as a color value. That is, the - level-colors option will map the given colors to black and white and stretching all the other colors between them linearly. This effectively removes the range of colors given from the image. And while this works, it is not particularly useful, as it is prone to fail for colors that have common values in some channel. For example, the colors DodgerBlue and White have the same color values in the blue channel. As such, - level-colors DodgerBlue, White may not always convert those colors to black and white. The better technique in that case is to extract a greyscale image of the channel with the highest differences (such as red) and level or normalize that channel. WARNING: watch out for transparent colors. The plus form of the operator level-colors on the other hand is extremely useful as it will map the black and white color to the given values compressing all the other colors linearly to fit the two colors you give. For example lets map black and white to green , and gold . As you can see the grayscale gradient is remapped into a gradient bound by the colors given, and although colors outside a gray-scale range are also modified, they will also follow the basic style of the color range specified. This makes the level-colors operator an extremely useful one, especially when mapping grayscale images. If you only supply one colorname but include a comma, the missing color will default either to black or white as appropriate. This makes it easy to convert grayscale images into a gradient for any color you like. For example here I remap a black and white gradient to a red and white gradient, (note the , in the argument). This didnt just replace black with red but also re-mapped all the anti-aliased gray colors to an appropriate mix of red and white, producing a very smooth result. If I had just performed a simple Direct Color Replacement converting pure black colors to red, I would end up with the horrible image (showen right). See Fuzz Factor for the example used to generate that image. Of course if you want one of the colors to be made transparent instead you are better off using the - alpha Shape operator instead, as this requires you to transfer the gradient into the alpha channel. If you only specify a single color, without any comma separator, that color will be used for both black and white points. That means all the colors in the image will be reset to that one color. (according to the current - channel setting limitations). This is an identical result to using - fill DodgerBlue - colorize 100 to Colorize Images (see below). If you want to set the images transparency setting as well you will need to set - channel to include the transparency channel, OR set the Alpha Channel to fully-opaque, using either - alpha opaque or - alpha off . Here are a few more examples of using this to adjust or tint a colorful image, rather than a gray-scale image. In summary the level-colors is a gradient color replacement, a linear tinting operator, and can also completely reset colors. Sigmoidal Non-linearity Contrast From a PDF paper on Fundamentals of Image Processing (page 44) they present an alternative to using a linear contrast control (level), with one using gamma correction known as sigmoidal non-linearity contrast control . The result is a non-linear, smooth contrast change (a Sigmoidal Function in mathematical terms) over the whole color range, preserving the white and black colors, much better for photo color adjustments. The exact formula from the paper is very complex, and even has a mistake, but essentially requires with two adjustment values. A threshold level for the contrast function to center on (typically centered at 50 ), and a contrast factor ( 10 being very high, and 0.5 very low). For those interested, the corrected formula for the sigmoidal non-linearity contrast control is. Where alpha is the threshold level, and beta the contrast factor to be applied. Here is a alternate version of the formula using intermedite variables. x exp( beta ( alpha - u)) y exp( beta 1 result (x y 1) (1 (x 1) - 1 y) The formula is actually very simple exponential curve, with the bulk of the above formula is designed to ensure that 0 remains zero and 1 remains one. That is, the graph always goes though the points 0,0 and 1,1. And the highest gradient of change is at the given threshold. Here for example is a - fx implementation of the above formula, resulting from a very high contrast value of 10 and a 50 threshold value. These values have been rolled into the floating point constants, to speed up the function. I did say 10 was a very heavy contrast factor. In fact anything higher than this value can be considered to be more like a fuzzy threshold operation, rather than a contrast enhancement. For a practical example of using this operator see the advanced Gel Effects Example. where it is used to sharpen the bright area being added to a shaped area color. Miscellaneous Contrast Operators Adjustments Using Histogram Modification This section was a joint effort by Fred Weinhaus and Anthony Thyssen. What is a histogram A histogram is a special type of graph. It simply sorts the color levels of the pixels in an image into a fixed number of bins each of which span some small range of values. As such each bin contains a count of the number of color levels (pixel values) in the image that fall into that range. The result is a representation of how the color values that make up an image are distributed, from black at the left, to white at at the right. The histogram can be generated for each channel separately or as a global histogram which looks at values from all the channels combined. The result is often displayed as a image of a bar chart. In IM, this is done using the special Histogram: output format. For example. But it can also be displayed as a line graph where the line connects the tops of the bars. This will be demonstrated later in the discussion below. See Histogram: for more details of this special output format. This is recommended reading at this point as it is the best way to extract histogram information about images using IM. A histogram charts actual height has little actual meaning, since it is usually scaled so that the highest peak touches the top of the image. As such the height of each individual bar is not relevant. What is much more important is the distribution of the histogram over the whole range, and how the relative heights relate to each other over the whole of the chart. When looking at a histogram you would consider the following factors. Does the histogram form one wide band of values This means that the image makes wide use of the colorspace and thus has good contrast. Or is it all in a tight group in the middle or at one end of the range This means the image has a low contrast, making it look fogged or grayed, or perhaps overly light or dark. Does it form two or more peaks As a result of highly different areas or regions in the image. Where are most of the pixels At the left, meaning the image is very dark. Or at the right, meaning it is very bright. Or spread out around the middle Are there regular gaps or empty spaces between individual bars This usually means either the image has very few pixels, so it could not completely fill out the whole histogram, or the image was color reduced, or modified in some way, so as to produce those gaps. Essentially a histogram is a simpler representation of an image, and as such it is much easier to change or adjust an image in terms of its histogram. Almost any mathematical color transformation that one applies to an image will normally cause not only the image to be modified, but its histogram as well. These include linear operations such as the Level Operator or non-linear operations such as the Gamma Operator. (see above). The mapping graphs we saw above represent how the graylevels in an image and thus how the images histogram is to be transformed. For example, lets make a low contrast image to demonstrate. However, the final result is that it not only modifies the image, but does so by modifying the images histogram (by compressing it). In the above case, - contrast. is a simple Level type operator that adds just a little more contrast to the image. the result of this is that the histogram itself is spread out more, causing it to cover the whole of the possible color range better. You can also see from the histograms, before and after, that the colors will also end up with gaps and holes between the bins, due to the way in which the stretching was performed. Specifically it creates a histogram with all the colors being places into bin. These binned colors are then modified as a whole, causing the image colors to be grouped together. It is not a particularly good way of handling image colors. This operator however works blindly, without any knowledge of the image content or color distribution. It thus cannot be done without some user control, as the operator could very easily make any image it is applied to, worse, rather than better. In this section we will look at image processing operators that examine the images histogram as part of its decision making process. It then modifies images using the result this study, so as to enhance some quality of the image color distribution. As these operators make use of actual information coming from the image being processed, they can often be used more globally over many images with much checking by the user. Operators of this type include automatic linear level type operators such as - normalize , - contrast-stretch , and - linear-stretch , but also non-linear ones such as - equalize , and others that may eventually be included into ImageMagick such as Fred Weinhauss script, redist . Histogram Stretching The simplest techniques, like the previous example simply stretch the histogram of the image outward to improve the color range. However instead of just blindly picking the black-point and white-point for Level operation, they select points based on the images histogram. Basically they count up the number of color values in each histogram bin, from each of the two ends, inward until they reach some threshold. These points will then be used as the black-point and white-point for the histogram (level) stretching. Basically the histogram counts provide the graylevel values that the stretch will force to black and white. This means that all pixels in the image that fall within the range of bins from pure black to the selected black-point bins corresponding graylevel will end up pure black. Likewise those pixels in the image that fall within the range of bins from from pure white to the white-point bins corresponding graylevel will end up pure white. The pixels that are outside these points however will have been stretched outside the possible color range of values, and as a result they will be simply be set to the range limits. That is these pixels are clipped burned-in as they are converted to the extreme of pure black or pure white color values. As a result if the threshold limits for selecting the black-point and white-point is set too high, you will get lots of black and white areas in the image, with the resulting histogram having large counts (tall bars) at the extreme end bins. Example of severe burn-in -- Chinese Chess Image Summary of stretch operators . - contrast-stretch, and - linear-stretch all generate a histogram (using 1024 bins) to determine the color position to stretch. as such it is not exact. The other difference is how zero is handled, and that - linear-stretch actually does a - level operation to do the stretch, while - contrast-stretch uses histogram bin values for color replacement stretching (which introduces a 1024 quantum rounding effect. - normalize uses - contrast-stretch internally. A mathematically perfect normalization stretching operator is - auto-level. While a perfect white-point only or black-point only version is posible it has not been implemented at this time. Auto-Level - perfect mathematical normalization The - auto-level finds the largest and smalled values in the image to use to stretch the image to the full Quantum Range. At no time will values become clipped or burned as a result of the histogram being stretch beyond the value range. The - channel setting will determine if all channels are stretch equally in sync (using the maximum and minimum over all channels) or separatally (each individual channel as a separate entity). At this time the hidden color of fully-transparent pixels, are also used in determining the levels, which can cause some problems when transparency is involved. This is regarded as a bug. It is a pure-mathematical histogram stretch just as the manual Level Operator is. That is the minimum will be adjusted to zero and maximum to Quantum range, and a linear equation is used to adjust all other values in the image. It does not use histogram bins or any other grouping of values that other methods may use for either determining the levels to be used, or other histogram adjustments. The - normalize operator is the simplest of these three operators. It simply expands the grayscale histogram so that it occupies the full dynamic range of gray values, while clipping or burning 2 on the low (black) end and 1 on the on the high (white) end of the histogram. That is, 2 of the darkest grays in the image will become black and 1 of the lightest grays will become white. This is not a large loss in most images, and the overall result is that the contrast (intensity range) of the image will be automatically maximized. A idealized diagram is needed here Example using chinese chess Here we create a gray-scale gradient, and expand it to the full black and white range. For practical reasons to do with JPEG color inaccuracies (see JPEG Color Distortion for more details) and scanned image noise, - normalize does not expand the very brightest and darkest colors, but a little beyond those values. That is, it is equivalent to a - contrast-stretch with a value of 2,99 (see below). This means if highest and lowest color values are very close together, - normalize will fail, an no action will be taken. If you really want to expand the exact brightest and darkest color values to their extremes use - auto-level instead. Up until IM version 6.2.5-5, - normalize worked purely as a grayscale operator. That is, each of the red, green, blue, and alpha channels were expanded independently of each other according to the - channel setting. As of IM version 6.2.5-5, if only the default channel setting is given, then - normalize will tie together all the color channels, and normalizes them all by the same amount. This ensures that pixel colors within the image are not shifted. However, it also means that you may not get a pure white or black color pixel. For example here we added some extra colors (a blue to navy gradient) to our normalization test image. As you can see from the last example, for color images - normalize maximized all the channels together so one channel has a zero value, and another channel has a maximum value. That is, no black pixels were generated, as all the added blue colors already contain zero values in the red and green channels. As such the lower bounds of the image did not expand. If you want the old - normalize behaviour (before IM v6.2.5-5), you will need to specify any non-default - channel setting. For images that contain no alpha (or matte) channel, you can just use the all channel setting. Note that the number of parameters ( a to d in above) needed for curve fitting, must equal the number of control points you provide. As such if you want five control points you need to include another e term to the function. If your histogram curve goes though the fixed control points 0,0 and 1,1. you really only need two parameters as d will be equal to 0 , and c will be equal to 1-a-b . A more detailed usage guide to the above specifically for Windows users, but works for linux users too, has been posted on StackOverflow: IM Curves using Gnuplot on Windows. As you can see from the extra gnuplot generated image above, the function generated fits the control points perfectly. Also as it generated a - fx style formula it can be used as is as an IM argument. To make it easier for users to convert control points into a histogram adjustment function, I have created a shell script called imfxcurves to call gnuplot , and output a nicer looking polynomial equation of the given the control points. Gabe Schaffer, also provided a perl version (using a downloaded Math::Polynomial library module) called imfxcurves. pl to do the same thing. Either script can be used. For example here is a different curve with 5 control points. A more practical example of this method is detailed in the advanced Aqua Effects example. An alternative away generating curves is looked at in the IM Forum Discussion Arbitrary tonal reproduction curves. Tinting Images Uniformly Color Tinting Images Typically tinting an image is achieved by blending the image with a color by a certain amount. This can be done using an Evaluate Operator or Blend Images techniques, but these are not simple to use. Lucky for us a simpler method of bleeding a uniform color into an image is available by using the - colorize image operator. This operator blends the current - fill color, into all the images in the current image sequence. The alpha channel of the original image is preserved, with only the color channels being modified. For example lighten an image (gray scale or otherwise) we use - colorize to blend some amount of white into the image, making it brighter without saturating the image completely. Similarly we can use a black fill color to darken an image. To gray both ends of the image toward the mid-tones, you would use a specific gray fill color. The color gray50 is the exact middle color of the RGB color spectrum. This is also often used as an method of de-contrast such as what the Reverse Level Adjustment Operator provides, though with less control. The - colorize operator also allows you to specify dissolve percentages for each of the three color channels separately. This is useful for linearly darkening (or lightening) an image in a special way. Before IM v6.7.9 the - colorize operator did not modify the alpha channel at all. From that version onwards, as you can see above, it now uniformly tints all pixels including fully transparent pixels. One common use of the - colorize operator is to simply replace all the colors in an existing image (tinting 100 ), but preserve the transparency (alpha) shape of the image, so as to produce a colored mask. However from IM v6.7.9 you will need to protect the alpha channel from this operator by disabling it, then re-enabling the alpha channel. (See Alpha On for more details). Without this protection, colorize would have fully-blanked the canvas to the given color. However if there is a posibility of using a verion of IM older than IM v6.7.9 I recommend you include a - alpha opaque or - alpha off operation in the above to ensure the resulting image is the completely blank image you expect. Note that you can blank canvases faster using Level Adjustments by Color operator with a single color, rather than a range of colors. See also Blank Canvases. Midtone Color Tinting While the Colorize operator applies the - fill color to tint all the colors in an image linearly, the - tint operator applies the - fill color in such a way as to only tint the mid-tone colors of an image. The operator is a grayscale operator, and the color is moderated or enhanced by the percentage given (0 to 200). To limit its effects it is also adjusted using a mathematical formula so that it will not effect black and white. but have the greatest effect on mid-tone colors of each color channel. A - tint 100 essentially will tint a perfect gray color so that it becomes half the intensity of the fill color. A lower value will tint it to a darker color while a higher value will tint it so toward a perfect match of that color. The green color in the test image is not a true RGB green, but a Scaled Vector Graphics green , which is only half as bright as a true green color. As such it is also a mid-tone color, and thus is affected by the - tint operator, becoming darker, unlike red and blue color spots of the test image. Also you can tint the individual color components, by using a comma separated list of percentages. For example - tint 30,40,20,10 . This however can be tricky to use and may need some experimentation to get right. Better to specify the color you want for perfect 50 grays. The - tint operator works by somehow taking the color and percentages given then then adjusting the individual colors in the image according to the - fill colors intensity, as per the following formula. (see graph right) A quadratic function, the result of which is used as vector for the existing color in the image. As you can see gives a complete replacement of the color for a pure mid-gray, with no adjustment for either white or black. Or lower level operators that you can use to DIY this sort of thing, see FX Operator. as well as Evaluate and Function Operators. The tinting operator is perfect to adjust the results of the output of - shade , (See Shade Overlay Highlight Images ), such as the examples in 3d Bullet Images. You can also use - tint to brighten or darken the mid-tone colors of an image. This is sort of like a gamma adjustment for images, though not exactly. For example using a tint value greater than 100 with a white color will brighten the mid-tones. While a value less than 100 will darken colors. See also Hald Color Lookup Tables for a method by which you can save much more complex color change variations, such as the last example above. Duotone Effect A duotone is a printing method where you mix the grayscale of an image (black ink) with some other color to produce a better result, with a limited budget or printing equipment. For example the reason all the old photos you see today have a sepia-tone look about them, is because sepia-tone inks survived and did not deteriorate, or fade with time. Other black and white images formats faded into uselessness. See the Sepia Tone Operator above. Another duotone technique known as Cyanotype (more commonly known as blue-prints) became widely used as method of making large scale copies of the original black and white architect drawings. Remember this tenchique was used long before the invention of lazers and from that photo-copying (and Xerox). The above Tint Operator however produces a reasonable facsimile of the duotone effect, just as it did for a sepia-tone like effect above. Note that I generally chose a darker version of the duotone color, but you can also adjust this using the argument of the Tint Operator. The brightness and contrast can also be adjusted using the arguments of the Sigmoidal Contrast Operator. Another more exacting way of generating a duotone from three colors (the black-point, mid-point and white-point colors) is to use a Color Lookup Table (see below). Here is just a quick example where I create a very unusual duotone using the colors Black , Chocolate , and LemonChiffon for the duotone. And yes the black-point color is typically left black, which is why it is usally called duo - tone. The advantage of the above is an exact control of the mid-point color (unlike Tint which isnt exact). You can also use any the three colors you like directly, just as in the above example, or use an expanded gradient of the colors for finer control of the colors between the three (or more) control points. The technique also provides you with a very compact way of storing the specific duotone effect, for repeated and future usage. Also see Hald Color Lookup Tables for more complex method of saving color changes, that go beyond coloring greyscale images. Color Tinting, DIY One of the biggest problems with - tint is that it is a grayscale (or vector) operator. That is, it handles each of the red, green, blue channels completely separately to each other. That in turn means that a primary and secondary color like blue or yellow are not affected by - tint , even though all the gray levels are. However thanks to various channel mathematical transforms such as the FX Operator and the faster Evaluate and Function Operators. you can generate your own color overlays to modify the image. That is, to Tint the image in a similar what that the Colorize Operator does. For example, here I convert an images gray-scale brightness level into a semi-transparent overlay of the specific color wanted. Warning, this does not preserve image transparency correctly, but it will work fine for fully-opaque images. Note that unlike tint, any color can be used, including black as the color is not treated as a vector addition, but an alpha composition. The result is not quite the same as what you would get for a normal tint. Color Tinting Overlay The special Alpha Composition methods Overlay and Hardlight were actually designed with color (and pattern) tinting in mind. These compose methods also will replace mid-tone grays leaving black and white highlights in the image alone. For example here I quickly generate a colored overlay image, and compose it to tint the original image. As you can see the alpha composition does not preserve any transparency of the original image, requiring the use of a second alpha composition operation to fix this problem. The alpha composition method HardLight will produce the same results as Overlay but with the source and destination images swapped. This could have been used instead of the swap in the last few examples. Global Color Modifiers Modulate Brightness, Saturation, and Hue The - modulate operator is special in that it modifies an image in the special HSL (hue-saturation-lightness) colorspace. It converts each color pixel in into this color space and modifies it and converts it back to its original color space. It takes three values (though later values are optional) as a percentage such that 100 will make no change to an image. For example. The first value, brightness is a multiplier of the images overall brightness. Note that while a brightness argument of 0 will produce a pure black image, you cannot produce a pure white image using this operator on its own. The second value saturation is also a multiplier adjusting the overall amount of color that is present in the image. A saturation of 0 will produce a grayscale image, as was also shown in Converting Color to Gray-Scale above. The gray however mixes all three color channels equally, as defined by the HSL colorspace, as such does not produce a true intensity grayscale. Essentially small values produce more pastel colors, while values larger than 100 will produce more cartoon-like colorful images. Note that as the brightness and saturation are percentage multipliers, you would need to multiply by a very large number to change almost all the image color values to near maximum. That is you would need to use a brightness factor of close to one million, to make all colors except pure black, white. Hue Modulation The final value, Hue . is actually much more useful. It rotates the colors of the image, in a cyclic manner. To achieve this the Hue value given produces a modulus addition, rather than a multiplication. However be warned that the hue is rotated using a percentage, and not by an angle. This may seem weird but - modulate has always been that way. Conversion formulas between angle and the modulate argument is. hueangle ( modulatearg - 100 ) 180100 modulatearg ( hueangle 100180 ) 100 That means 100 (for all three arguments) produces no change. While a value of 0 or 200 will effectivally negate the colors in the image (but not the intensity). As you can see a value of 33.3 produces a negative, or counter-clockwise rotation of all the colors by approximately 60 degrees, effectively mapping the red to blue, blue to green, and green to red. Using values of 0 or 200 produces a complete 180 degree negation of the colors, without negating the brightness of the image. Note that hues are cyclic, as such using a value of 300 will produce a 360 degree color rotation, and result in no change to the image. For examples of using Hue Modulation to modify colors in images see, Chroma Key Masking and Pins in a Map. These types of operations and more can also be applied using advanced Color Space techniques, such as using in Recolor Matrix Operator (below), but for basic modulation of an image, this operator greatly simplifies things. For primary color swapping, either Recolor Matrix Operator. or channel swapping (see SeparateCombine Operators ), is probably more accurate technique. Though it is much less versatile. See also Hald Color Lookup Tables for a method by which you can save color change variations, especially changes in Hue, for later reuse. Modulate DIY You can if really want to Do It Yourself. You basically convert the image into the appropriate color space, modify the values, and convert back. Remember that in HSL Color Space. the Green channel holds the Saturation value, and the Blue channel holds the Luminance value. For example here is the equivalent to a - modulate 80,120 (darken slightly, increase color saturation), using the default HSL colorspace. Of course if you modify the Hue (red channel) using this method you will need to ensure the final value wraps around (a modulus), rather than simply clipping the value at the maximum or minimum value (both of which is the red hue). As such it is probably easier to just directly use the Modulate Operator. for Hue modifications. Modulate in Other Colorspaces The biggest problem with - modulate is when handing images containing a lot of near white colors. As it does its work in HSL colorspace, colors that are off-white will become more saturated as the brightness is reduced. You can see this in the white leaf of the rose image above, which shows lots of color artifacts at a 50 darkening. This is especially a problem when dealing with JPEG image formats, as it tends to generate off-white colors (actually all colors are generally slightly off in JPEG) due to its lossy compression algorithm. For example. The problem here is that in HSL all the off white colors were packed into a small white point area of the color space used (a double cone). When brightness is then reduced the off-white colors get expanded as the cone of color expands, causing the off white color to generate a more colorful (saturated) set of off-white colors. That is, small variations in color are exaggerated. The solution to this is to - modulate in the HSB colorspace, instead of HSL colorspace. The B in HSB, means Brigthness, but is also commonally known as HSV, with using V meaning Value. They are the same colorspace, but V is a confusing term, as a value normally means a stored number. There is also a HSI colorspace, (using I of Intensity) but it is uncommon, and not needed due to the addition of the HCL (where L means Luminance) cyclic colorspace (see below). In the HSB colorspace, white is not a single point, but a large disk, and as such off-whites, are not close to each other. As such when you reduce the brightness, the off-whites contract equally, reducing any slight color variations rather than expanding them. As such the whites just become gray, and not more colorful. To modulate the image in HSB Color Space you can either use the DIY technique (see above) in that colorspace. Or with IM v6.5.3-7 and later, you can Define an Operational Control of modulate:colorspace with one of the Hue color spaces. Other Hue colorspaces is HWB, and HCL (see next section). Of course if you resized the image to this small size, an even better solution is NOT to save the image to JPEG, which was the cause of the off-white values. Better still dont save the image at all, until after you are finished, so you can keep all the color values at the best in-memory quality setting. The reason HSB colorspace is not used by default for modulate, is because if you brighten an image in this colorspace the colors become more saturated, and bolder, rather than the image becoming more brilliant and whiter. Here for example is a 150 brighten of the rose image in the default HSL, and a specified HSB colorspace, for comparison. Before IM v6.4.0-10 the - modulate operator actually did use HSB color space rather than HSL colorspace. This was changed because of a bug report by a user about the above situation. The point is for some images you are damned if you use HSL, and for other images you are damned if you use HSB colorspace. It just depends on what you are attempting to do Modulate in LCHab and LCHuv Colorspace Hue modulation (in HSL or HSB colorpsace) is actually regarded as rather crude. These colorspaces do not take into account a more realistic intensity of the colors. As such rotating between the hues blue and yellow will also generate very large brightness shifts. See Wikipedia: Disadvantages to HSL Colorspace . One alternative is to do a Luminance preserving rotation as described on the Grafica Obscura in the Matrix Operations Paper. This is complex as the color modifications are being done as part of the operation, as a single calculated matrix operation that is different depending on how much of a rotation is required. As of IM v6.8.4-7 the Modulate Operator can also handle the special colorspaces LCHuv and LCHab which are Cylindrical (Hue-Chroma) forms the the respective Luv and Lab colorspaces. see Wikipedia, Cylindrical LUV, or LCHuv colorspace and The HCL Colorspace for more information. The equivelent channels of LCHuv and LCHab colorspaces are reverse to those of the HCL and HCB colorspaces. That is the grayscale intensity equivelent is in the first (red) channel and Hue is in the third (Blue) channel of the image. For example we do some hue rotations for the red rose using LCHuv colorspace. Compare these with the previous set for the HSL colorspace above. Note how the blue is nowhere near as dark, but is a shade that better matches the shade of the original image. You can also do the same in LCHuv though I found the hue spead more restrictive. For more information on HCL colorspace hues, see the examples on The LCH Color Wheel. Before IM v6.8.4-7 you would have used the colorspace HCL (introduced IM v6.7.9-1). This colorspace is exacty the same as LCHuv but with the channel order reversed so that Hue was in the first channel, so as to better match HCL colorspace. This spacial channel reversal allowed modulate to work properly, without it needing to understand different channel ordering for different colorspaces. This no longer required, so you can now use the more commonly known channel ordering for the cylindrical version of the Luv colorspace. You can also use a LCHab (cylindrical version of the Lab ) colorspace, however this version has discontinuities for specific impossible color values, especially in the green area. It is not recommended for use with the Modulate Operator. Color Matrix Operator The - color-matrix operator will recolor images using a matrix technique. That is to say you give it a matrix of values which represents how to linearly mix the various color channel values of an image to produce new color values. Typical usage is to provide the operator with 9 values, which form three functions (rows) or three multipliers (columns). As such the first three numbers is the color formula for the red channel. The next for green and so on For example. Future: Hue rotations using a color matrix However be warned that most of these implementations use a Diagonally Transposed form of the matrix, in which columns form the equation, instead of the rows. Or involve fewer channels (smaller number of rowscolumns). Solarize Coloring To - solarize an image is to basically burn the brightest colors black. The brighter the color, the darker the solarized color is. This happens in photography when chemical film is over exposed. Basically anything above the grayscale level given is negated. So if you give a argument of 0 you basically have a poor mans Negate Operator. For example here is a faked - solarize using a - fx mathematical formula. This operator is particularly well suited to extracting the midtone gray colors from images. For example here I use very strong Sigmoidal Contrast operation to produce a sort of fuzzy threshold at 70 gray. I then Solarize the result to generate a fuzzy-spike rather than a fuzzy-threshold. A final level adjustment then brings the spike to maximum brightness to generate a filament effect. ASIDE: The above images showing profile graphs of the gradient, was generated using the improfile in the IM Examples, Scripts directory. Note how anything that is white becomes black, while the mid-tone grays around the central spike are preserved. The fuzziness and placement of the spike is determined by the - sigmoidal-contrast operator. I call it a filament as typically the result looks remarkably like glowing electrical filaments, or lightning discharges. See Random Flux for another example of this effect. This extraction of mid-tone grays is also put to good use in techniques for generating Edge Outlines from Bitmap Shapes. and for the multiplication of two biased gradients. Another novel use of this operation is in determining if an image is basically a pure black and white sketch or drawing (such as from a book), rather than a shaded gray-scale or color images, See Determining if an image is: Pure Black and White, or Gray-scale Recoloring Images with Lookup Tables While you can recolor images using the various histogram color adjustments as shown above, there is another technique for recoloring images, simply by looking up the modified values from a pre-prepared color gradient, or Color Look Up Tables (Color LUT, or CLUT). There are two types of Color LUTs: simple one dimensional or per-channel LUTs and 3d color LUTs. A channel LUT has three independent look-up tables: one each for the R G and B channels. Each entry in the channel LUT maps an input channel value to an output channel value. The red channel of the output image is only effected by the original red value of the input image. A 3D color LUT however allow the whole color to be replaces as a function of the whole input color. That is the output value of the red channel can be dependent on any or all of the input red, green, and blue values. This is sometimes called channel cross-talk. Color (Channel) Lookup Tables A common requirement of a image processing tool is the ability to replace the whole range of colors, from a pre-prepared table of colors. This allows you to convert images of one set of colors (generally gray-scale) into completely different set of colors, just by looking up its replacement color from a special image. Of course you do need a Look Up Table image from which to read the replacement colors. For these first few examples, I choose to use a vertical gradient of colors for the LUT so that the IM gradient: generator can be used to simplify the generation of the color lookup table. Well so much for the theory. Let try it out by recoloring a simple gray-Scale Plasma image, replacing the grayscale with a dark-blue to off-white gradient of colors. The - clut operator takes two images. The first is the image to replace color values in, the second is a gradient image that is either a single row, or a single column. The - clut operator was added to IM v6.3.5-8. If your IM is too old to understand the - clut operator or you want to do something out of the ordinary, such as a 2 dimensional color lookup table, then you can roll your own using the General DIY Operator, FX. For example here is a slow, but equivalent command to the above. The problem is that even for a simple process such as the above the - fx operator is very slow, and has to be designed specifically for either a row or column LUT. But it does work. The LUT does not have to be very large. For example here we use a very small LUT, with a very limited number of colors. I enlarged the gradient image for the web page display above, otherwise it would be too small to see properly. The LUT is in actual fact only 6 pixels in size. However if you look at the result you will see that the Color Lookup Operator smooths out those 6 colors into a smooth gradient. What is happening is that IM is doing an Interpolated Lookup of the LUT image. That is, instead of just picking the color found, it does a weighted average of all the nearby colors to better represent the LUT. In this particular case, it used the default Bilinear setting that just links each colored pixel together with linear line segments. Different - interpolate settings generate different levels of smoothing of the colors when using a very small color LUT. Here for example I show a various type of interpolated smoothing of the LUT colors. The Integer and Nearest settings are special in that they do no smoothing colors at all. That is, no new mixed colors will be added, only the exact color values present will be used used to color a grayscale image. However note how the lookup of the colors differ between the two. It is a subtle difference but can be very important. The Average setting on the other hand also generated bands of color but only using a mix of the colors, resulting in one less color than the size of the color lookup table image. Blend however mixes Average and Nearest together, to add more pixels. This type of color banding (or Blocking Artefacts ) is actually rather common for geographic maps, and temperature graphs, as it gives a better representation of the exact shape of the map. The sharp boundary edges are known as iso-lines. Adding a slight one pixel Blur to the final image can improve the look of those edges, making it look a little smoother, without destroying the color banding. The BiLinear setting will also generate banding but only in the form of sharp gradient changes, when the colors change sharply (not in this example). While Catrom will smooth out the color changes. Finally Spline will blur the colors, and may not generate any of the colors in the given CLUT. To avoid interpolation problems, or better define the color gradients, the best idea is to use much longer LUT. Ideally this should cover the full range of possible intensity values. For ImageMagick Q16 (compiled with 16 bit quality) that requires a LUT to have a height of 65536 pixels. But Pixel Interpolation allows you to use a more reasonable LUT gradient image of 500 pixels suitable for most image re-coloring tasks. Note that the vertical gradient LUT used in the above examples appears upside-down to our eyes, as the black or 0 index is at the top of the image. Normally we humans prefer to see gradients with the black level at the bottom (thanks to our evolutionary past). If you rather save the gradient image the right way up you can - flip the image as you reading it in. For example lets try a more complex LUT, flipping the vertical gradient before using it on the image. As you can see for a vertical gradient, flipping it before using makes a lot of sense. For more examples of generating gradients see Gradients of Color. You may also be interested in a way of tiling greyscale images using a image for each grey level, which can produce even better map like images. See Dithering with Patterns. Function to Color LUT Conversion These pre-prepared Lookup Table Images (or LUTs) can also be used to greatly increase the speed of very complex and thus slow - fx operations, so instead of IM interpreting the functional string 3 or 4 times per pixel, it can do a much faster lookup of the replacement color. The procedure for doing this is quite straight forward, either apply the function to a unmodified linear gradient, or replace the u in the function with the value (iw) or (jh) to calculate the replace value based on its position. For example, in the advanced Aqua Effects example, I used a complex - fx function to adjust the gray-scale output of the Shade operator . Also as this gray-scale adjustment is also overlaid onto a DodgerBlue shape, there is no reason why the results of both of these operators could not be combined into a single gradient lookup table. That is, we generate a LUT from the - fx formula and the color overlay. Also for these examples I decided to generate a single row of pixels rather than a column as I did previously. The polynomial - fx in the above can now be generated more directly and faster using a Polynomial Function. For example This pre-generated LUT can now be applied to the shaded shape much more quickly at the minimal cost of storing a very small image. As you can see, the result is very effective, and once an appropriate LUT gradient has been generated, you can re-use the same gradient over and over, as many times as you want. CLUT and Transparency Handling The - clut operator is controlled by the - channel setting, but in reality, it only replaces the individual channel values within the image. That means that normally each individual channel of the source image is used to lookup the replacement value for just that channel from the color lookup table. That includes the alphamatte channel which is usually very inconvenient, and difficult to apply. Typically the - clut operator is used to either colorize a gray-scale source image, (see previous examples), OR it is used to do a histogram adjustment of a color image using a gray-scale CLUT (Color Lookup Table). In other words, usually one of the images will typically be gray-scale. As of IM v6.4.9-8, if a - channel setting specifies that if you are wanting to replaceadjust the alpha channel of an image (an A is present), and either the source image or CLUT image has no alphamatte channel defined, then IM will assume that that image is gray-scale, and will act accordingly. For example, here I generate a simple blurred triangle, as a grey-scale image. I can then color using a Color Lookup Table that includes transparency. I did not flip the CLUT image this time, so the black replacement will be at the top and white replacement at the bottom. Remember the above will only work as expected if the gray-scale image has no alpha channel (turned off using either - alpha off or matte ), and you specify that you also want to lookup alpha channel values (using - channel RGBA ). And here is the other special case where were have an image with transparency (and alpha channel) that needs to be adjusted using a gray-scale histogram adjustment gradient (with no alpha channel enabled). The above is a typical Image Feathering problem. The black halo in the intermediate image is caused by the - blur operation making the fully-transparent areas surrounding the triangle visible. As fully-transparent has an undefined color, IM defaults to black. The CLUT image itself was designed to ensure that any pixel that was less than 50 transparent will be turned fully-transparent, effectively making the previously fully transparent parts of the image, transparent again. For this example I over-do the initial blur, then over-correct the alpha channel adjustment. The result is a sever rounding of the points of the triangle. For normal image feathering would typically use much smaller values for both the - blur and the - sigmoidal-contrast alpha adjustment. Fred Weinhaus. has implemented a blurred feathering technique in his feather script, to make it easier to use. Hald 3D Color Lookup Tables As of IM v6.5.3-4 you can now also use a full 3D Color Lookup Table which can be used to directly replace all the colors of multiple images. That is, instead of just looking up the value of each each color channel as a separate entity (as in the CLUT above), the whole color is used to lookup the new color. However a 3D color tables usually require special file formats to correct store the 3D array of color values. However by using a special arrangement of color values the 3D table can be stored into a 2D image known as a Hald Color LUT . This is just a normal image and as such ANY good image file format can be used to save a Hald 3D Color LUT. For more details and examples of HALD Images, see the official website Hald Images, Clut Technology. To generate a Hald 3D color table, use the HALD: level image generator. For example, here is a small one that I have enlarged so you can see the individual pixels. The table holds a color cube with a side of level 2 colors or 9 colors. The full color cube contains 9 times 9 times 9 colors, giving a total of 729 colors, which is stored in a image of that numbers square root, or 27x27 pixels. The colors are stored so the first 9 colors (in the top-left corner) forms a gradient going from pure-black to pure-red. Every 9 th color then forms a gradient in green, and every 81 st color will form a gradient of blue. The last color in the bottom-right corner is pure-white. You can think of the image as an even simpler 1D array of pixels that are referenced as a 3D color cube, if it helps you to imagine it. Now this is only a small HALD CLUT image. More typically you would use at least a level 8 Hald ( the default ), which will hold a color cube with 64 colors per side, or 643 262144 colors, and produce an image that is 512x512 pixels in size. and saves into into an approximate 10Kbyte PNG image. This is not all 8 bit colors but is quite good. For a HALD image with every 8 bits color, you would need a level 16 version, producing a 4096x4096 image. Whcih just does to prove that even normal digital camera images generally can not hold every posible 8 bit color. However a smaller Hald image can be used, as IM will interpolate the neighbouring 8 colors from the Hald to work out the final color for the lookup replacement. It will simply not be as good a representation as a larger version. Hald images larger than 8 are not recommended, and would require very large images, of at least 16 bits per value depth to hold it. Now these generated hald images are the identity or no-op CLUT images. That is, they are the normal colors values forming the 3D color cube, and as such will produce no change the image. For example lets apply a no-op Hald image, using the - hald-clut operator. This image is exactly the same as the original, and the Hald image contained no changes. However by modifying the Hald image, either by hand, or using a color modification, then you can substitute the original colors for the modified colors. For example here I create a blended-sepia-tone color scheme. Of course if you can apply a specific color modification to a Hald image, you can also apply it to the actual image directly too. But you can now save your color modifications to reuse them, and can then be applied as many times as like. That means you can spend your effort on the halt, and save it for the future. You can also send, or download Hald CLUT images for other people and even other applications. You could even directly edit the colors in a Hald, using a image editor like Gimp or Photoshop , or if saved in a Enumerated Pixel Text Image use a plain text editor All this is especially the case for very complex color modifications Please mail me any Hald CLUT images you have found interesting or useful, and I will example them here. You will be credited, here as well Hald CLUT Limitations Unlike the simpler 1 Dimensional gradient lookup using the CLUT Operator you can use a Hald CLUT to rotate colors. For example swap red and blue colors. It is a much more versatile CLUT method. However it is not as good for doing simpler things like coloring a gray-scale image, or doing a histogram adjustment of color values. It can also replace colors with transparent, or semi-transparent values, by saving such replacement colors in the Hald CLUT image. However this replacement lookup is by color only. You cannot use it to replace transparent colors in specific ways. It isnt after all a 4D color lookup hyper-cube Color Replacement using Hald CLUT Now as the whole color value is used to lookup the color replacement, you could also use this as a method of directly replacing all the colors in an image with some other color. However as IM currently does a linear interpolated lookup of the Hald, you will need to set the replacement color in all 8 neighbouring color cells of the 3D color cube. This needs more work, and may need a nearest-neighbour Hald Lookup setting (say using - interpolate), rather than a 3D linear interpolated lookup to work better for specific color replacement. Also some easy way of locating specific colors in a Hald (nearest-neighbour, or the 8 neighbours) would make this a lot easier. If you have ideas, suggestions, or better still small examples, then please contribute by mailing them to me, or the IM Discussion Forums Another idea is that if you have two images, the original and the converted, then it should be possible to fill-in a Hald CLUT image from the comparison of the two images. When the immediate colors have been filled in the rest of the color cube should be able to be at least roughly derived by curve fitting the colors that are present. That is, create a 4-D color surface from the color changes discovered. When complete than you can apply the Hald CLUT to any other image so as to either make the same color transformation (in either direction) to any other image. Full Color Map Replacement FUTURE: Replace all the colors in one color map with colors in another color map. Suggestions as to how to best do this is welcome, or programmers to implement some image color map function. One method may be to use ideas presented in Dithering with Symbols. The best known solution (but hardly ideal) is currently provided by Fred Weinhaus in is mapcolors script. This script essentially maps each color one at a time, masking the pixels involved from one image into a new initially blank image. Another idea is to somehow map a 3 dimentional color replacement into a HALD Color Table. This will not just map the specified colors, but also re-map the colors between the specified colors in a logical way. HALD generator wanted. Created: 19 December 2003 Updated: 6 October 2011 Author: Anthony Thyssen. ltA. Thyssen64griffith. edu. au gt Examples Generated with: URL: imagemagick. orgUsagecolormodsThis is a guest post from 8220DerivsTrading,8221 who founded SampT Careers to teach you how to win bulge bracket trading interviews and offers and ace your assessment centers. He8217s an experienced flow options trader currently working at a bulge bracket bank in London, and he defied the odds to break in coming from a non-target school. We8217ve covered a few days and 48-hour periods in the lives of sales amp trading interns before, but what about when you start working full-time Even if the hours and stress levels are still brutal, do you at least get to do more real work Or are you stuck picking up lunch for everyone on your desk Lets jump into this day-in-the-life account and see exactly what you do as a full-time options trader at a bulge bracket bank and hey, you might even improve your knowledge of the Greek language in the process 5:45 AM: Wake up. No matter which desk you end up on, you are most likely going to be waking up around this time. Adjust your sleeping habits accordingly or suffer for most of the day. Also keep in mind that even if you go out the night before, you are still expected to be in on time and alert. Any signs that you are at less than 100 capacity will be looked upon very badly. 6:30 AM: Arrive on the desk. The market opens in 90 minutes, so its really a countdown from here. 20 minutes is spent just turning on all the systems with 4 computers and each one running 10-15 different applications, this is quite time-consuming. Inevitably, youll forget to log into at least one crucial system each day and then realize it at the absolute worst moment. 6:50 AM: Start reading various new sources generally FT, Bloomberg, City AM, and then the internal research that comes out. Finish off with a couple broker chats. You need to know, before the open, any market information that can affect your stocks how it might affect your PampL and what the cash traders are calling it that day (most cash traders after a big piece of news will call a stock up or down x). 7:15 AM: Look at the largest positions on the book and try to come up with a rough game plan for the day. I generally like to make a list of risks I dont like, in order of priority, and then work down the list throughout the day. You want to make sure you know the biggest risks in every category (e. g. gamma, vega, delta, decay, skew, div). NOTE FOR NON-TRADERS: These metrics all measure characteristics of options for example, delta is the rate of change of the option value relative to the changes in the underlying assets price (basically the first derivative with respect to price). Vega is the first derivative of the options value with respect to the underlying assets volatility gamma is the second derivative of the options value with respect to underlying asset price (so the first derivative of delta). In a large options book there is also a lot of hidden risk. Therefore, you cant just look at your overall risk for a name you need to know where your largest strikes are, and how your risk changes through spot and time. For example, you might see yourself long gamma, but actually you might be short a strike that expires in 2 weeks that is 10 away. You need to know about all of that because if the stock makes a big move, that strike will start kicking out a very large short gamma (this is also why most traders are unwilling to sell short dated OTM options). Morning Meetings: The Worst Time to Show Up with a Hangover 7:30 AM: Morning meeting with sales and research, which is generally the worst moment of your entire day if you have had a rough night out. The macro summary is given, and then everyone discusses important research updates. 7:50 AM: Take one final glance over the stock news to make sure you havent missed anything just before the open (which is at 8 AM in London and a few other regions). You never want your boss to ask you a question that you dont have an answer to: if youre running risk, you need to be aware of everything at all times. 8:00 AM: The market opens. You watch any big movers, see that cash equity prices find their levels fairly quickly but volatility (vol) levels adjust a bit more slowly generally, within the first 10 minutes you get an idea of where vol is on most names. If there are earnings or big announcements, you will generally not quote until the screens come in a bit. For the first 10 minutes, the vol spread will be extremely wide and you can easily get picked off. 8:15 AM: First wave of client requests comes in. If you cover several sectors, you can get a backlog of 7-10 prices pretty quickly. You prioritize all these requests by client and size even when you only have a couple minutes for each price, you need to make sure you have all your bases covered. Options trading is very tricky because there are so many different risks you need to make sure youre not being picked off on vol (check if anything similar in the broker market is already trading to hedge your risk and skew pricing accordingly), make sure youre not being picked off on divs, and make sure that you can find borrow on the stock if youre selling shares as part of the trade. If the government steps in and restricts short-selling for some reason, this last risk can become more of an issue. US vs. European Options 8:30 AM: Finally send off last of the prices, get some time to look at how the book is doing, and start phoning up brokers and start working some trades. Options on single stocks in Europe trade a bit differently than in the US because the liquidity is not the same the issue is that screen prices are kept very tight in extremely small sizes, and clients expect the same spreads in sizes that are 50x larger. But the problem is that unless you can find someone to find the other side in the broker market. you will get wider prices with brokers than you give to your clients. This means that to survive, you constantly need to be aware of what brokers are working so that you can spot chances to offload risk. That way, when a client request comes in you can skew it appropriately. The best case scenario: when you know someone is a buyer in the broker market, you can buy it from a client at a vol from mids, and then offload it in the broker market at a vol above. However, this is very rare, so most of the time you need to make a price based on a prop view (if you will). You need to price it according to your view of the trade, instead of where you can offload it. 9:15 AM: Things start calming down around this time, and you might chat with co-workers or use the time to go for a bathroom break. Always go when you have a chance and not when you need to nothing distracts you more than having to go to the bathroom when youre in the middle of something. 10:00 AM: Its still fairly quiet, so you finally get to fire up Excel and work on some longer-term projects. It gets difficult on a flow book because you need to find the balance between looking after the risk, but at the same time also exploring opportunities to move the business forward. 10:15 AM: Spoke too soon a big client request comes in, and its a good client so the price needs to be very competitive. This is a double-edged sword: you can take a lot of PampL upfront on the trade, but you know that getting out of the position is impossible and will take a couple weeks. So you price it with the help of the senior guys on the desk and get back to Excel. 12:00 PM: A company youre following announces a profit warning unfortunately, you have a short gamma position and the stock is down 5. This is one of the situations you hate to be in. NOTE: This is bad news because gamma is the second derivative of an options value with respect to the underlying stock price so if youre long gamma, you benefit from stock price movement, and the bigger the better. If youre short gamma that hurts you because youve bet against stock price movement and now the stock has just made a big move. Because of the short gamma, you are long a lot of delta. Do you sell the shares 5 down, or hold on and hope it rallies back As a personal rule, I like to keep my deltas from my short gammas to a certain limit, and I hedge so that it never crosses that limit. You do not want to be stuck with a stock that drops 20 in a day and just sit there watching it. Its important that you know everything about your short gammas, more so than your longs, because if something gaps down you need to know the impact on your PampL and delta. With longs its fine because of the positive PampL, but negative PampL always brings more senior attention and means that youre more likely to get questions on what youre doing. You also need to make sure you know not just your local risk, but also your risk as spot prices move. In a client flow book you have thousands of positions, so your risk can quite easily flip as parameters move. That is why you need to look at your risk in three dimensions: time, spot, and volatility. These added dimensions make derivatives more interesting than delta one products (e. g. futures, forwards, or anything else with a linear, symmetric payoff profile), but also harder to risk-manage. 12:30 PM: The stock has calmed down so you get back to Excel, keeping an eye on the chart in the corner of the screen in case theres any follow-up movement. 1:30 PM: You attend an IT meeting for 30 minutes, where youre really just listening to updates on various projects that theyre working on for trading desks. 2:00 PM: You get back to the desk to find 10 prices waiting for you. Lock back into the cockpit. Pricing becomes routine after a while. This can become dangerous, especially with very small requests. You have to make sure that for every single price, you are very rigorous in assessing all the different risks you can easily get picked off because you missed an announcement in a company conference call that dividends were being changed or restructured, for example. 3:00 PM: You have a big short gamma expiry today that is OTC and has just rallied close to the strike. Pin risk is very real. The stock is trading just above the strike and you are fully hedged, which means that if it dips below, the delta flips from 0 to 1 (or 1 to 0 but it has the same effect), so all of a sudden you get very long delta if its a sizeable position. A long delta position isnt a problem if the stock stays near that strike, but it could then drop 3 and you would lose quite a bit in that scenario. However, if you sell shares and it comes back up through the strike you get short a lot of delta. This situation gets even worse if the stock is illiquid and you get longshort several times the daily volume. Your choices are very limited at these times, and you need to be aware of the strike risk days or weeks leading up to the expiry so you can plan accordingly. 4:00 PM: You slowly start hedging the smaller delta positions on the book so you can spend the last 15 minutes focusing on the 10-15 large positions and expiries. This is one of the most hectic times of the day, as you need to hedge quite a large percentage of daily volume for a lot of stocks. In addition, several prices come in for clients, and you are trying to finish off some stuff you have been working in the broker market. On a standard day there are 20-30 things you need to be on top of, and so mentally it does stretch you a bit. Another tricky thing is that different markets close at different times of the day, so you cant necessarily stop paying attention or finish up right away as soon as the market of the city youre in closes. 4:35 PM: The markets close, so you finish off all outstanding bookings before running the final PampL for the day. Technically, your day is done once you submit the PampL, but you normally stay until 6 PM to work on your longer-term projects and think about new trade ideas. Its the only time of the day where you dont need to monitor something, so its actually the most productive time for new business generation as well. 6:45 PM: Wrap things up and head home. This is a guest post from 8220DerivsTrading,8221 who founded SampT Careers to teach you how to win bulge bracket trading interviews and offers and ace your assessment centers. He8217s an experienced flow options trader currently working at a bulge bracket bank in London, and he defied the odds to break in coming from a non-target school. He offers a comprehensive SampT interview guide that includes 100 technical (equities, credit, FX, interest rates, and options theory) and behavioral questions, a guide to generating trade ideas, secrets on how to beat the intern 8220trading game,8221 and full support and access to a forum where you can ask all your questions and receive answers from professional traders. NOTE FROM BRIAN: And yes, as I said in another guest article from a few months ago. this interview guide is great if you8217re looking to prepare for the technical side of SampT interviews and want something more in-depth. It goes well beyond the simple fit and markets-based questions we8217ve covered on the site before, into possible interview questions on the concepts discussed above. This is the best SampT interview guide I have seen if you are already comfortable with the fundamentals and want to learn even more. Holy Christ, I started developing an ulcer around 12:00 PM of your day. How do you deal with the stress Do you genuinely find what you do rewarding The way it was written it seems like you are always on tenterhooks that the bottom is going to drop out and you are going to get royally fucked somehow. Thanks for doing this, incredibly interesting Haha thats not a bad way to put it, yes you do honestly sit there a lot of the time going through those 8220getting fucked scenarios8221, because especially with options there are so many hidden risks that a big part of the job is trying to make sure you are aware of them. For example a simple scenario is that you are long gamma with earnings coming up, but lets say earnings are 24th of May but most of your long gamma rolls off on the 22nd (its an OTC position). Now once that rolls off lets say you are flat gamma, but actually you have some short Jun13 downside options so if the stock drops 4 you actually become short gamma very quickly. This is quite a simple scenario, but the trick comes when you have a book of 100 names that you have to keep track of these types of things for each one. Stress comes from missing something like this and losing money because of an oversight on your part. In terms of general stress, theres currently a thread on wallstreetoasis where i hve written quite a bit on general stress in a trading seat. Not sure if Brian allows to post links but its quite easy to find. Thanks I will dig the thread up. Do you like what you do I know you mentioned the timevolspot makes things interesting, but it seems like no regular human could keep track of all those things for 100 names8230 what happens if you get really sick and cant come in Does another trader take care of your book for the day (I imagine that must be incredibly hard if they too have to think about their own 100 names). Thanks again so much for the response Incredibly educational reading your experiences. Yea i find it very interesting every day, and i love having something where results are so directly trackable every day. In terms of monitoring everything, you honestly get used to it. Your eyes become very well adapted at searching for things on all the screens. Also there is always a hierarchy of things you are looking at, so you will always have 4-5 fires that are at your forefront of your mind, and then the other 90 things are on the backburner because they arent crucial, and you pay attnetion to them when you get a chance. In terms of covering books, most teams have a system, and there will usually always be some cross coverage so multiple people on a book.

No comments:

Post a Comment